use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class LegacyCombinatorTestCase method testReqAndRankAndNot.
public void testReqAndRankAndNot() {
Query q = new Query("?query.yahoo=2&query.yahoo.defidx=1&query.yahoo.operator=not&query.juhu=b&query.juhu.defidx=nalle&query.juhu.operator=rank&query.bamse=z&query.bamse.defidx=y");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("+(RANK y:z nalle:b) -1:2", q.getModel().getQueryTree().toString());
}
use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class LegacyCombinatorTestCase method testReqAndRank.
public void testReqAndRank() {
Query q = new Query("?query.juhu=b&query.juhu.defidx=nalle&query.juhu.operator=rank&query.bamse=z&query.bamse.defidx=y");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("RANK y:z nalle:b", q.getModel().getQueryTree().toString());
}
use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class LegacyCombinatorTestCase method testDefaultIndexWithoutQuery.
public void testDefaultIndexWithoutQuery() {
Query q = new Query("?defidx.juhu=b");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("NULL", q.getModel().getQueryTree().toString());
q = new Query("?query=a&defidx.juhu=b");
e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("a", q.getModel().getQueryTree().toString());
}
use of com.yahoo.prelude.IndexFacts 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.prelude.IndexFacts 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());
}
Aggregations