public final class NRTSuggester extends java.lang.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 |
|---|---|
java.util.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 java.util.Collection<Accountable> getChildResources()
AccountablegetChildResources in interface AccountableAccountablespublic 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) throws java.io.IOException
NRTSuggester from IndexInputjava.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.