use of com.yahoo.search.query.parser.Parser in project vespa by vespa-engine.
the class ParsingTester method parseQuery.
public Item parseQuery(String query, String filter, Language language, Query.Type type, Linguistics linguistics) {
Parser parser = ParserFactory.newInstance(type, new ParserEnvironment().setIndexFacts(indexFacts).setLinguistics(linguistics).setSpecialTokens(tokenRegistry.getSpecialTokens("default")));
Item root = parser.parse(new Parsable().setQuery(query).setFilter(filter).setLanguage(language)).getRoot();
if (root instanceof NullItem) {
return null;
}
return root;
}
Aggregations