org.apache.lucene.search
public abstract class Scorer extends Object
| Constructor Summary | |
|---|---|
| protected | Scorer(Similarity similarity) Constructs a Scorer. |
| Method Summary | |
|---|---|
| abstract int | doc() Returns the current document number. |
| abstract Explanation | explain(int doc) Returns an explanation of the score for doc. |
| Similarity | getSimilarity() Returns the Similarity implementation used by this scorer. |
| abstract boolean | next() Advance to the next document matching the query. |
| void | score(HitCollector hc) Scores all documents and passes them to a collector. |
| abstract float | score() Returns the score of the current document. |
| abstract boolean | skipTo(int target) Skips to the first match beyond the current whose document number is
greater than or equal to target. |
doc.Returns true iff there is such a match.
Behaves as if written:
boolean skipTo(int target) {
do {
if (!next())
return false;
} while (target > doc());
return true;
}
Most implementations are considerably more efficient than that.