use of com.enonic.xp.query.suggester.TermSuggestionQuery in project xp by enonic.
the class SuggestionQueriesTest method testBuilder.
@Test
public void testBuilder() {
final TermSuggestionQuery query = TermSuggestionQuery.create("queryName").field("category").text("value").analyzer("analyzer").size(1).maxEdits(2).prefixLength(3).minWordLength(4).maxInspections(5).minDocFreq(6f).maxTermFreq(7f).sort(TermSuggestionQuery.Sort.FREQUENCY).suggestMode(TermSuggestionQuery.SuggestMode.ALWAYS).stringDistance(TermSuggestionQuery.StringDistance.INTERNAL).build();
final SuggestionQueries queries = SuggestionQueries.create().add(query).build();
assertNotNull(queries);
assertTrue(queries.isNotEmpty());
assertTrue(queries.contains(query));
}
Aggregations