public class SuggestIndexSearcher
extends IndexSearcher
CompletionQuery can be used to suggest documents.
Use PrefixCompletionQuery for analyzed prefix queries,
RegexCompletionQuery for regular expression prefix queries,
FuzzyCompletionQuery for analyzed prefix with typo tolerance
and ContextQuery to boost and/or filter suggestions by contexts| Constructor and Description |
|---|
SuggestIndexSearcher(IndexReader reader)
Creates a searcher with document suggest capabilities
for
reader. |
| Modifier and Type | Method and Description |
|---|---|
TopSuggestDocs |
suggest(CompletionQuery query,
int n,
boolean skipDuplicates)
Returns top
n completion hits for
query |
void |
suggest(CompletionQuery query,
TopSuggestDocsCollector collector)
Lower-level suggest API.
|
public SuggestIndexSearcher(IndexReader reader)
reader.public TopSuggestDocs suggest(CompletionQuery query, int n, boolean skipDuplicates) throws java.io.IOException
n completion hits for
queryjava.io.IOExceptionpublic void suggest(CompletionQuery query, TopSuggestDocsCollector collector) throws java.io.IOException
collector for query.
TopSuggestDocsCollector.collect(int, CharSequence, CharSequence, float)
is called for every matching completion hit.
java.io.IOExceptionData In Motion GmbH all rights reserved