final class TermScorer extends Scorer
Scorer for documents matching a Term.Scorer.ChildScorer| Modifier and Type | Field and Description |
|---|---|
private Similarity.SimScorer |
docScorer |
private PostingsEnum |
postingsEnum |
| Constructor and Description |
|---|
TermScorer(Weight weight,
PostingsEnum td,
Similarity.SimScorer docScorer)
Construct a
TermScorer. |
| Modifier and Type | Method and Description |
|---|---|
int |
docID()
Returns the doc ID that is currently being scored.
|
int |
freq()
Returns the freq of this Scorer on the current document
|
DocIdSetIterator |
iterator()
Return a
DocIdSetIterator over matching documents. |
float |
score()
Returns the score of the current document matching the query.
|
java.lang.String |
toString()
Returns a string representation of this
TermScorer. |
getChildren, getWeight, twoPhaseIteratorprivate final PostingsEnum postingsEnum
private final Similarity.SimScorer docScorer
TermScorer(Weight weight, PostingsEnum td, Similarity.SimScorer docScorer)
TermScorer.weight - The weight of the Term in the query.td - An iterator over the documents matching the Term.docScorer - The Similarity.SimScorer implementation
to be used for score computations.public int docID()
Scorer-1 if the Scorer.iterator() is not positioned
or DocIdSetIterator.NO_MORE_DOCS if it has been entirely consumed.docID in class ScorerDocIdSetIterator.docID()public int freq()
throws java.io.IOException
Scorerpublic DocIdSetIterator iterator()
ScorerDocIdSetIterator over matching documents.
The returned iterator will either be positioned on -1 if no
documents have been scored yet, DocIdSetIterator.NO_MORE_DOCS
if 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 float score()
throws java.io.IOException
ScorerDocIdSetIterator.nextDoc() or
DocIdSetIterator.advance(int) is called on the Scorer.iterator()
the first time, or when called from within LeafCollector.collect(int).public java.lang.String toString()
TermScorer.toString in class java.lang.Object