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 contextsIndexSearcher.LeafSliceleafContexts, readerContext| 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.
|
collectionStatistics, count, createWeight, doc, doc, doc, explain, explain, getDefaultQueryCache, getDefaultQueryCachingPolicy, getDefaultSimilarity, getExecutor, getIndexReader, getQueryCache, getQueryCachingPolicy, getSimilarity, getSlices, getTopReaderContext, rewrite, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, setDefaultQueryCache, setDefaultQueryCachingPolicy, setQueryCache, setQueryCachingPolicy, setSimilarity, slices, termStatistics, termStatistics, toStringpublic SuggestIndexSearcher(IndexReader reader)
reader.public TopSuggestDocs suggest(CompletionQuery query, int n, boolean skipDuplicates) throws IOException
n completion hits for
queryIOExceptionpublic void suggest(CompletionQuery query, TopSuggestDocsCollector collector) throws IOException
collector for query.
TopSuggestDocsCollector.collect(int, CharSequence, CharSequence, float)
is called for every matching completion hit.
IOExceptionCopyright © 2000-2024 Apache Software Foundation. All Rights Reserved.