public final class NRTSuggester extends Object implements Accountable
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 |
|---|---|
Collection<Accountable> |
getChildResources()
Returns nested resources of this class.
|
static NRTSuggester |
load(IndexInput input)
Loads a
NRTSuggester from IndexInput |
void |
lookup(CompletionScorer scorer,
Bits acceptDocs,
TopSuggestDocsCollector collector)
Collects at most
TopSuggestDocsCollector.getCountToCollect() completions that
match the provided CompletionScorer. |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
public long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic Collection<Accountable> getChildResources()
AccountablegetChildResources in interface AccountableAccountablespublic void lookup(CompletionScorer scorer, Bits acceptDocs, TopSuggestDocsCollector collector) throws 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)
IOExceptionpublic static NRTSuggester load(IndexInput input) throws IOException
NRTSuggester from IndexInputIOExceptionCopyright © 2000–2015 The Apache Software Foundation. All rights reserved.