use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class StemmingSearcherTestCase method testEmptyIndexInfo.
@Test
public void testEmptyIndexInfo() {
String indexInfoConfigID = "file:src/test/java/com/yahoo/prelude/querytransform/test/emptyindexinfo.cfg";
ConfigGetter<IndexInfoConfig> getter = new ConfigGetter<>(IndexInfoConfig.class);
IndexInfoConfig config = getter.getConfig(indexInfoConfigID);
IndexFacts indexFacts = new IndexFacts(new IndexModel(config, (QrSearchersConfig) null));
Query q = new Query(QueryTestCase.httpEncode("?query=cars"));
new Execution(new Chain<Searcher>(new StemmingSearcher(linguistics)), new Execution.Context(null, indexFacts, null, null, linguistics)).search(q);
assertEquals("cars", q.getModel().getQueryTree().getRoot().toString());
}
use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class LowercasingTestCase method setUp.
@Before
public void setUp() throws Exception {
IndexFacts f = new IndexFacts();
Index bamse = new Index(BAMSE);
Index teddy = new Index(TEDDY);
Index defaultIndex = new Index("default");
bamse.setLowercase(true);
teddy.setLowercase(false);
defaultIndex.setLowercase(true);
f.addIndex("nalle", bamse);
f.addIndex("nalle", teddy);
f.addIndex("nalle", defaultIndex);
f.freeze();
settings = f;
execution = new Execution(new Chain<Searcher>(new VespaLowercasingSearcher(new LowercasingConfig(new LowercasingConfig.Builder()))), Execution.Context.createContextStub(settings));
}
use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class WandSearcherTestCase method buildIndexFacts.
private IndexFacts buildIndexFacts() {
IndexFacts retval = new IndexFacts();
retval.addIndex("test", new Index(VESPA_FIELD));
retval.freeze();
return retval;
}
use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class QueryCombinatorTestCase method testStraightForwardSearch.
public void testStraightForwardSearch() {
Query q = new Query("?query=a&query.juhu=b");
Execution e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("AND a b", q.getModel().getQueryTree().toString());
q = new Query("?query=a&query.juhu=b&defidx.juhu=juhu.22[gnuff]");
e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("AND a juhu.22[gnuff]:b", q.getModel().getQueryTree().toString());
q = new Query("?query=a&query.juhu=");
e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("a", q.getModel().getQueryTree().toString());
q = new Query("?query=a+c&query.juhu=b");
e = new Execution(searcher, Execution.Context.createContextStub(new IndexFacts()));
e.search(q);
assertEquals("AND a c b", q.getModel().getQueryTree().toString());
}
use of com.yahoo.prelude.IndexFacts in project vespa by vespa-engine.
the class QueryCombinatorTestCase 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