use of org.apache.lucene.search.suggest.InputArrayIterator in project lucene-solr by apache.
the class BlendedInfixSuggesterTest method duplicateCheck.
private List<Lookup.LookupResult> duplicateCheck(Input[] inputs, int expectedSuggestionCount) throws IOException {
Analyzer a = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false);
BlendedInfixSuggester suggester = new BlendedInfixSuggester(newDirectory(), a, a, AnalyzingInfixSuggester.DEFAULT_MIN_PREFIX_CHARS, BlendedInfixSuggester.BlenderType.POSITION_RECIPROCAL, 10, false);
InputArrayIterator inputArrayIterator = new InputArrayIterator(inputs);
suggester.build(inputArrayIterator);
List<Lookup.LookupResult> results = suggester.lookup(TestUtil.stringToCharSequence("ear", random()), 10, true, true);
assertEquals(expectedSuggestionCount, results.size());
suggester.close();
a.close();
return results;
}
Aggregations