public class SpanScorer extends Scorer
- WARNING: This API is experimental and might change in incompatible ways in the next release.
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
docID()Returns the doc ID that is currently being scored.
getSpans()return the Spans for this Scorer
DocIdSetIteratorover matching documents.
score()Returns the score of the current document matching the query.
scoreCurrentDoc()Score the current doc.
public Spans getSpans()return the Spans for this Scorer
public int docID()Returns the doc ID that is currently being scored. This will return
Scorer.iterator()is not positioned or
DocIdSetIterator.NO_MORE_DOCSif it has been entirely consumed.
public DocIdSetIterator iterator()Return a
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()Optional method: Return a
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
Scorer.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
protected float scoreCurrentDoc() throws IOExceptionScore the current doc. The default implementation scores the doc with the similarity using the slop-adjusted
public final float score() throws IOExceptionReturns the score of the current document matching the query. Initially invalid, until
DocIdSetIterator.advance(int)is called on the
Scorer.iterator()the first time, or when called from within