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,
but this one has no Weight normalization factors/multipliers
and that one doesn't filter either.
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.
FunctionQueryScorer.ChildScorer| Modifier and Type | Field and Description |
|---|---|
protected FunctionValues |
values |
NO_MORE_DOCS| Modifier | Constructor and Description |
|---|---|
protected |
ValueSourceScorer(IndexReader reader,
FunctionValues values) |
| Modifier and Type | Method and Description |
|---|---|
int |
advance(int target) |
TwoPhaseIterator |
asTwoPhaseIterator() |
long |
cost() |
int |
docID() |
int |
freq() |
abstract boolean |
matches(int doc)
Override to decide if this document matches.
|
int |
nextDoc() |
float |
score() |
getChildren, getWeightall, empty, slowAdvanceprotected final FunctionValues values
protected ValueSourceScorer(IndexReader reader, FunctionValues values)
public abstract boolean matches(int doc)
TwoPhaseIterator.matches().public TwoPhaseIterator asTwoPhaseIterator()
asTwoPhaseIterator in class Scorerpublic int docID()
docID in class DocIdSetIteratorpublic int nextDoc()
throws IOException
nextDoc in class DocIdSetIteratorIOExceptionpublic int advance(int target)
throws IOException
advance in class DocIdSetIteratorIOExceptionpublic float score()
throws IOException
score in class ScorerIOExceptionpublic int freq()
throws IOException
freq in class ScorerIOExceptionpublic long cost()
cost in class DocIdSetIteratorCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.