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.LeafSlice
leafContexts, 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, getIndexReader, getQueryCache, getQueryCachingPolicy, getSimilarity, getSlices, getTopReaderContext, rewrite, search, search, search, search, search, search, searchAfter, searchAfter, searchAfter, setDefaultQueryCache, setDefaultQueryCachingPolicy, setQueryCache, setQueryCachingPolicy, setSimilarity, slices, termStatistics, toString
public SuggestIndexSearcher(IndexReader reader)
reader
.public TopSuggestDocs suggest(CompletionQuery query, int n, boolean skipDuplicates) throws IOException
n
completion hits for
query
IOException
public void suggest(CompletionQuery query, TopSuggestDocsCollector collector) throws IOException
collector
for query
.
TopSuggestDocsCollector.collect(int, CharSequence, CharSequence, float)
is called for every matching completion hit.
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.