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")));
}
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());
}
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");
}