public abstract class AbstractScorer extends Object implements Scorer
Scorer.
It provides internal caching of the underlying
document iterator during wrapping,
and a nextDocument() method that delegates
to the underlying document iterator (implementing subclasses
that do not alter this behaviour should implement DelegatingScorer).
The setWeights(Reference2DoubleMap)
method simply returns false.| Modifier and Type | Field and Description |
|---|---|
protected DocumentIterator |
documentIterator
The current document iterator.
|
protected IndexIterator[] |
indexIterator
In case the current iterator is just made of one or more index iterators.
|
| Constructor and Description |
|---|
AbstractScorer() |
| Modifier and Type | Method and Description |
|---|---|
Reference2DoubleMap<Index> |
getWeights()
Returns an empty map.
|
long |
nextDocument()
Returns the next document provided by this scorer, or -1 if no more documents are available.
|
boolean |
setWeights(Reference2DoubleMap<Index> index2Weight)
Returns false.
|
void |
wrap(DocumentIterator documentIterator)
Wraps the given document iterator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopy, score, score, usesIntervalsprotected DocumentIterator documentIterator
protected IndexIterator[] indexIterator
public void wrap(DocumentIterator documentIterator) throws IOException
This method records internally the provided iterator.
wrap in interface ScorerdocumentIterator - the document iterator that will be used in subsequent calls to
Scorer.score() and Scorer.score(Index).IOExceptionpublic boolean setWeights(Reference2DoubleMap<Index> index2Weight)
setWeights in interface Scorerindex2Weight - a map from indices to weights.public Reference2DoubleMap<Index> getWeights()
getWeights in interface Scorerpublic long nextDocument()
throws IOException
ScorernextDocument in interface ScorerIOException