private static class ContextQuery.ContextCompletionWeight extends CompletionWeight
Weight.DefaultBulkScorer
Modifier and Type | Field and Description |
---|---|
private int[] |
contextLengths |
private java.util.Map<IntsRef,java.lang.Float> |
contextMap |
private float |
currentBoost |
private java.lang.CharSequence |
currentContext |
private CompletionWeight |
innerWeight |
private BytesRefBuilder |
scratch |
parentQuery
Constructor and Description |
---|
ContextCompletionWeight(CompletionQuery query,
Automaton automaton,
CompletionWeight innerWeight,
java.util.Map<IntsRef,java.lang.Float> contextMap,
int[] contextLengths) |
Modifier and Type | Method and Description |
---|---|
protected float |
boost()
Returns the boost of the partial path set by
CompletionWeight.setNextMatch(IntsRef) |
protected java.lang.CharSequence |
context()
Returns the context of the partial path set by
CompletionWeight.setNextMatch(IntsRef) |
private void |
setInnerWeight(IntsRef ref,
int offset) |
protected void |
setNextMatch(IntsRef pathPrefix)
Set for every partial path in the index that matched the query
automaton.
|
bulkScorer, explain, extractTerms, getAutomaton, isCacheable, scorer
getQuery, matches, scorerSupplier
private final java.util.Map<IntsRef,java.lang.Float> contextMap
private final int[] contextLengths
private final CompletionWeight innerWeight
private final BytesRefBuilder scratch
private float currentBoost
private java.lang.CharSequence currentContext
public ContextCompletionWeight(CompletionQuery query, Automaton automaton, CompletionWeight innerWeight, java.util.Map<IntsRef,java.lang.Float> contextMap, int[] contextLengths) throws java.io.IOException
java.io.IOException
protected void setNextMatch(IntsRef pathPrefix)
CompletionWeight
CompletionWeight.boost()
and CompletionWeight.context()
to return an appropriate value with respect to the current pathPrefix.setNextMatch
in class CompletionWeight
pathPrefix
- the prefix of a matched pathprivate void setInnerWeight(IntsRef ref, int offset)
protected java.lang.CharSequence context()
CompletionWeight
CompletionWeight.setNextMatch(IntsRef)
context
in class CompletionWeight
protected float boost()
CompletionWeight
CompletionWeight.setNextMatch(IntsRef)
boost
in class CompletionWeight