public final class NRTSuggester
extends java.lang.Object
NRTSuggester executes Top N search on a weighted FST specified by a CompletionScorer
See lookup(CompletionScorer, Bits, TopSuggestDocsCollector) for more implementation
details.
FST Format:
NOTE:
CompletionScorer.accept(int, Bits)CompletionScorer.filtered set to true,
it is assumed that the filter will roughly filter out half the number of documents that match
the provided automaton| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<Accountable> |
getChildResources() |
static NRTSuggester |
load(IndexInput input,
CompletionPostingsFormat.FSTLoadMode fstLoadMode)
Loads a
NRTSuggester from org.apache.lucene.store.IndexInput on or off-heap
depending on the provided fstLoadMode |
void |
lookup(CompletionScorer scorer,
Bits acceptDocs,
TopSuggestDocsCollector collector)
Collects at most
TopSuggestDocsCollector.getCountToCollect() completions that
match the provided CompletionScorer. |
long |
ramBytesUsed() |
public long ramBytesUsed()
public java.util.Collection<Accountable> getChildResources()
public void lookup(CompletionScorer scorer, Bits acceptDocs, TopSuggestDocsCollector collector) throws java.io.IOException
TopSuggestDocsCollector.getCountToCollect() completions that
match the provided CompletionScorer.
The CompletionScorer.automaton is intersected with the fst.
CompletionScorer.weight is used to compute boosts and/or extract context
for each matched partial paths. A top N search is executed on fst seeded with
the matched partial paths. Upon reaching a completed path, CompletionScorer.accept(int, Bits)
and CompletionScorer.score(float, float) is used on the document id, index weight
and query boost to filter and score the entry, before being collected via
TopSuggestDocsCollector.collect(int, CharSequence, CharSequence, float)
java.io.IOExceptionpublic static NRTSuggester load(IndexInput input, CompletionPostingsFormat.FSTLoadMode fstLoadMode) throws java.io.IOException
NRTSuggester from org.apache.lucene.store.IndexInput on or off-heap
depending on the provided fstLoadModejava.io.IOExceptionData In Motion GmbH all rights reserved