use of com.yahoo.prelude.querytransform.CJKSearcher in project vespa by vespa-engine.
the class CJKSearcherTestCase method assertTransformed.
private void assertTransformed(String queryString, String expected, Query.Type mode, Language actualLanguage, Language queryLanguage, Linguistics linguistics) {
Parser parser = ParserFactory.newInstance(mode, new ParserEnvironment().setIndexFacts(indexFacts).setLinguistics(linguistics));
Item root = parser.parse(new Parsable().setQuery(queryString).setLanguage(actualLanguage)).getRoot();
assertFalse(root instanceof NullItem);
Query query = new Query("?language=" + queryLanguage.languageCode());
query.getModel().getQueryTree().setRoot(root);
new Execution(new Chain<Searcher>(new CJKSearcher()), new Execution.Context(null, indexFacts, null, null, linguistics)).search(query);
assertEquals(expected, query.getModel().getQueryTree().getRoot().toString());
}
Aggregations