public class CompletionWeight extends Weight
setNextMatch(IntsRef)
,
boost()
and context()
to calculate the boost and extract the context of
a matched path prefix.Weight.DefaultBulkScorer
parentQuery
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 |
boolean |
isCacheable(LeafReaderContext ctx)
This object can be cached
|
Scorer |
scorer(LeafReaderContext context) |
protected void |
setNextMatch(IntsRef pathPrefix)
Set for every partial path in the index that matched the query
automaton.
|
getQuery, matches, scorerSupplier
public CompletionWeight(CompletionQuery query, Automaton automaton) throws IOException
query
with an automaton
,
using the reader
for index statsIOException
public Automaton getAutomaton()
CompletionQuery
public BulkScorer bulkScorer(LeafReaderContext context) throws IOException
bulkScorer
in class Weight
IOException
protected 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 Weight
IOException
public boolean isCacheable(LeafReaderContext ctx)
public void extractTerms(Set<Term> terms)
extractTerms
in class Weight
public Explanation explain(LeafReaderContext context, int doc) throws IOException
explain
in class Weight
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.