public abstract class ValueSourceScorer extends Scorer
Scorer
which returns the result of FunctionValues.floatVal(int)
as
the score for a document, and which filters out documents that don't match matches(int)
.
This Scorer has a TwoPhaseIterator
. This is similar to FunctionQuery
,
with an added filter.
Note: If the scores are needed, then the underlying value will probably be fetched/computed twice -- once to filter and next to return the score. If that's non-trivial then consider wrapping it in an implementation that will cache the current value.
FunctionQuery
Scorable.ChildScorable
Modifier and Type | Field and Description |
---|---|
protected FunctionValues |
values |
Modifier | Constructor and Description |
---|---|
protected |
ValueSourceScorer(Weight weight,
LeafReaderContext readerContext,
FunctionValues values) |
Modifier and Type | Method and Description |
---|---|
int |
docID() |
float |
getMaxScore(int upTo) |
DocIdSetIterator |
iterator() |
abstract boolean |
matches(int doc)
Override to decide if this document matches.
|
float |
score() |
TwoPhaseIterator |
twoPhaseIterator() |
advanceShallow, getWeight
getChildren, setMinCompetitiveScore
protected final FunctionValues values
protected ValueSourceScorer(Weight weight, LeafReaderContext readerContext, FunctionValues values)
public abstract boolean matches(int doc) throws IOException
TwoPhaseIterator.matches()
.IOException
public DocIdSetIterator iterator()
public TwoPhaseIterator twoPhaseIterator()
twoPhaseIterator
in class Scorer
public float score() throws IOException
score
in class Scorable
IOException
public float getMaxScore(int upTo) throws IOException
getMaxScore
in class Scorer
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.