public class CompletionWeight extends Weight
setNextMatch(IntsRef),
boost() and context()
to calculate the boost and extract the context of
a matched path prefix.Weight.DefaultBulkScorerparentQuery| Constructor and Description |
|---|
CompletionWeight(CompletionQuery query,
Automaton automaton)
Creates a weight for
query with an automaton,
using the reader for index stats |
| Modifier and Type | Method and Description |
|---|---|
protected float |
boost()
Returns the boost of the partial path set by
setNextMatch(IntsRef) |
BulkScorer |
bulkScorer(LeafReaderContext context) |
protected CharSequence |
context()
Returns the context of the partial path set by
setNextMatch(IntsRef) |
Explanation |
explain(LeafReaderContext context,
int doc) |
void |
extractTerms(Set<Term> terms) |
Automaton |
getAutomaton()
Returns the automaton specified
by the
CompletionQuery |
float |
getValueForNormalization() |
void |
normalize(float norm,
float boost) |
Scorer |
scorer(LeafReaderContext context) |
protected void |
setNextMatch(IntsRef pathPrefix)
Set for every partial path in the index that matched the query
automaton.
|
public CompletionWeight(CompletionQuery query, Automaton automaton) throws IOException
query with an automaton,
using the reader for index statsIOExceptionpublic Automaton getAutomaton()
CompletionQuerypublic BulkScorer bulkScorer(LeafReaderContext context) throws IOException
bulkScorer in class WeightIOExceptionprotected void setNextMatch(IntsRef pathPrefix)
boost() and context()
to return an appropriate value with respect to the current pathPrefix.pathPrefix - the prefix of a matched pathprotected float boost()
setNextMatch(IntsRef)protected CharSequence context()
setNextMatch(IntsRef)public Scorer scorer(LeafReaderContext context) throws IOException
scorer in class WeightIOExceptionpublic void extractTerms(Set<Term> terms)
extractTerms in class Weightpublic Explanation explain(LeafReaderContext context, int doc) throws IOException
explain in class WeightIOExceptionpublic float getValueForNormalization()
throws IOException
getValueForNormalization in class WeightIOExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.