use of com.yahoo.search.searchchain.Execution in project vespa by vespa-engine.
the class LegacyCombinatorTestCase method testReqAndNotWithQuerySyntaxAll.
public void testReqAndNotWithQuerySyntaxAll() {
Query q = new Query("?query.juhu=b+c&query.juhu.defidx=nalle&query.juhu.operator=not&query.juhu.type=any&query.bamse=z&query.bamse.defidx=y");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("+y:z -(OR nalle:b nalle:c)", q.getModel().getQueryTree().toString());
}
use of com.yahoo.search.searchchain.Execution in project vespa by vespa-engine.
the class LegacyCombinatorTestCase method testNoBaseQuery.
public void testNoBaseQuery() {
Query q = new Query("?query.juhu=b");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("b", q.getModel().getQueryTree().toString());
}
use of com.yahoo.search.searchchain.Execution in project vespa by vespa-engine.
the class LegacyCombinatorTestCase method testNotCombinatorWithoutRoot.
public void testNotCombinatorWithoutRoot() {
Query q = new Query("?query.juhu=b&query.juhu.defidx=nalle&query.juhu.operator=not");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("NULL", q.getModel().getQueryTree().toString());
assertTrue("No expected error found.", q.errors().size() > 0);
System.out.println(q.errors());
assertEquals("Did not get invalid query parameter error as expected.", Error.INVALID_QUERY_PARAMETER.code, q.errors().get(0).getCode());
}
use of com.yahoo.search.searchchain.Execution in project vespa by vespa-engine.
the class NGramSearcherTestCase method assertGramsWithSegmentationMixedAndPhrases.
public void assertGramsWithSegmentationMixedAndPhrases(Chain<Searcher> chain) {
// "first" "second" and "third" are segments in the "test" language
Item item = parseQuery("a gram14:\"afirstsecondthird b hi\"", Query.Type.ALL);
Query q = new Query("?query=ignored");
q.getModel().setLanguage(Language.UNKNOWN);
q.getModel().getQueryTree().setRoot(item);
new Execution(chain, createContextStub(indexFacts)).search(q);
assertEquals("AND a gram14:\"afirstsecondth firstsecondthi irstsecondthir rstsecondthird b hi\"", q.getModel().getQueryTree().toString());
}
use of com.yahoo.search.searchchain.Execution in project vespa by vespa-engine.
the class NGramSearcherTestCase method testNGramRewritingMixedQuery.
public void testNGramRewritingMixedQuery() {
Query q = new Query("?query=foo+gram3:engul+test:bar");
new Execution(searcher, Execution.Context.createContextStub(indexFacts)).search(q);
assertEquals("AND foo (AND gram3:eng gram3:ngu gram3:gul) test:bar", q.getModel().getQueryTree().toString());
}
Aggregations