Search in sources :

Example 1 with VespaSearcher

use of com.yahoo.search.federation.vespa.VespaSearcher in project vespa by vespa-engine.

the class VespaSearcherTestCase method testVespaSearcher.

public void testVespaSearcher() {
    VespaSearcher v = new VespaSearcherValidatingSubclass();
    new Execution(v, Execution.Context.createContextStub()).search(new Query(com.yahoo.search.test.QueryTestCase.httpEncode("?query=test&filter=myfilter")));
}
Also used : VespaSearcher(com.yahoo.search.federation.vespa.VespaSearcher) Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query)

Example 2 with VespaSearcher

use of com.yahoo.search.federation.vespa.VespaSearcher in project vespa by vespa-engine.

the class VespaIntegrationTestCase method testIt.

// TODO: Setup the answering vespa searcher from this test....
public void testIt() {
    if (System.currentTimeMillis() > 0)
        return;
    Chain<Searcher> chain = new Chain<>(new VespaSearcher("test", "example.yahoo.com", 19010, ""));
    Result result = new Execution(chain, Execution.Context.createContextStub()).search(new Query("?query=test"));
    assertEquals(23, result.hits().size());
}
Also used : Chain(com.yahoo.component.chain.Chain) VespaSearcher(com.yahoo.search.federation.vespa.VespaSearcher) Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query) VespaSearcher(com.yahoo.search.federation.vespa.VespaSearcher) Searcher(com.yahoo.search.Searcher) Result(com.yahoo.search.Result)

Example 3 with VespaSearcher

use of com.yahoo.search.federation.vespa.VespaSearcher in project vespa by vespa-engine.

the class QueryParametersTestCase method testQueryParameters.

public void testQueryParameters() {
    Query query = new Query();
    query.properties().set("a", "a-value");
    query.properties().set("b.c", "b.c-value");
    query.properties().set("source.otherSource.d", "d-value");
    query.properties().set("source.testSource.e", "e-value");
    query.properties().set("source.testSource.f.g", "f.g-value");
    query.properties().set("provider.testProvider.h", "h-value");
    query.properties().set("provider.testProvider.i.j", "i.j-value");
    // Done by federation searcher
    query.properties().set("sourceName", "testSource");
    // Done by federation searcher
    query.properties().set("providerName", "testProvider");
    VespaSearcher searcher = new VespaSearcher("testProvider", "", 0, "");
    Map<String, String> parameters = searcher.getQueryMap(query);
    searcher.deconstruct();
    // 5 standard + the appropriate 4 of the above
    assertEquals(9, parameters.size());
    assertEquals(parameters.get("e"), "e-value");
    assertEquals(parameters.get("f.g"), "f.g-value");
    assertEquals(parameters.get("h"), "h-value");
    assertEquals(parameters.get("i.j"), "i.j-value");
}
Also used : VespaSearcher(com.yahoo.search.federation.vespa.VespaSearcher) Query(com.yahoo.search.Query)

Aggregations

Query (com.yahoo.search.Query)3 VespaSearcher (com.yahoo.search.federation.vespa.VespaSearcher)3 Execution (com.yahoo.search.searchchain.Execution)2 Chain (com.yahoo.component.chain.Chain)1 Result (com.yahoo.search.Result)1 Searcher (com.yahoo.search.Searcher)1