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 automatonNULL_ACCOUNTABLE
Modifier and Type | Method and Description |
---|---|
Collection<Accountable> |
getChildResources() |
static NRTSuggester |
load(IndexInput input,
CompletionPostingsFormat.FSTLoadMode 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()
ramBytesUsed
in interface Accountable
public Collection<Accountable> getChildResources()
getChildResources
in interface Accountable
public 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)
IOException
public static NRTSuggester load(IndexInput input, CompletionPostingsFormat.FSTLoadMode fstLoadMode) throws IOException
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.