Search in sources :

Example 1 with StemmingSearcher

use of com.yahoo.prelude.querytransform.StemmingSearcher 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());
}
Also used : Chain(com.yahoo.component.chain.Chain) Execution(com.yahoo.search.searchchain.Execution) IndexFacts(com.yahoo.prelude.IndexFacts) Query(com.yahoo.search.Query) ConfigGetter(com.yahoo.config.subscription.ConfigGetter) QrSearchersConfig(com.yahoo.container.QrSearchersConfig) StemmingSearcher(com.yahoo.prelude.querytransform.StemmingSearcher) IndexInfoConfig(com.yahoo.search.config.IndexInfoConfig) IndexModel(com.yahoo.prelude.IndexModel) Test(org.junit.Test)

Aggregations

Chain (com.yahoo.component.chain.Chain)1 ConfigGetter (com.yahoo.config.subscription.ConfigGetter)1 QrSearchersConfig (com.yahoo.container.QrSearchersConfig)1 IndexFacts (com.yahoo.prelude.IndexFacts)1 IndexModel (com.yahoo.prelude.IndexModel)1 StemmingSearcher (com.yahoo.prelude.querytransform.StemmingSearcher)1 Query (com.yahoo.search.Query)1 IndexInfoConfig (com.yahoo.search.config.IndexInfoConfig)1 Execution (com.yahoo.search.searchchain.Execution)1 Test (org.junit.Test)1