public abstract class Scorer extends Scorable
Scorer exposes an
iterator() over documents
matching a query in increasing order of doc Id.
Document scores are computed using a given
NOTE: The values Float.Nan,
Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are
not valid scores. Certain collectors (eg
TopScoreDocCollector) will not properly collect hits
with these scores.
|Modifier and Type||Field and Description|
the Scorer's parent Weight
|Modifier||Constructor and Description|
Constructs a Scorer
|Modifier and Type||Method and Description|
Advance to the block of documents that contains
Return the maximum score that documents between the last
returns parent Weight
docID, getChildren, score, setMinCompetitiveScore
protected final Weight weight
protected Scorer(Weight weight)
weight- The scorers
public Weight getWeight()
public abstract DocIdSetIterator iterator()
DocIdSetIteratorover matching documents. The returned iterator will either be positioned on
-1if no documents have been scored yet,
DocIdSetIterator.NO_MORE_DOCSif all documents have been scored already, or the last document id that has been scored otherwise. The returned iterator is a view: calling this method several times will return iterators that have the same state.
public TwoPhaseIterator twoPhaseIterator()
TwoPhaseIteratorview of this
Scorer. A return value of
nullindicates that two-phase iteration is not supported. Note that the returned
approximationmust advance synchronously with the
iterator(): advancing the approximation must advance the iterator and vice-versa. Implementing this method is typically useful on
Scorers that have a high per-document overhead in order to confirm matches. The default implementation returns
public int advanceShallow(int target) throws IOException
targetin order to get scoring information about this block. This method is implicitly called by
DocIdSetIterator.nextDoc()on the returned doc ID. Calling this method doesn't modify the current
DocIdSetIterator.docID(). It returns a number that is greater than or equal to all documents contained in the current block, but less than any doc IDS of the next block.
targetmust be >=
Scorable.docID()as well as all targets that have been passed to
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.