Methods Summary |
---|
public abstract int | doc()Returns the current document number. Initially invalid, until {@link
#next()} is called the first time.
|
public abstract org.apache.lucene.search.Explanation | explain(int doc)Returns an explanation of the score for doc .
|
public org.apache.lucene.search.Similarity | getSimilarity()Returns the Similarity implementation used by this scorer.
return this.similarity;
|
public abstract boolean | next()Advance to the next document matching the query. Returns true iff there
is another match.
|
public void | score(org.apache.lucene.search.HitCollector hc)Scores all documents and passes them to a collector.
while (next()) {
hc.collect(doc(), score());
}
|
public abstract float | score()Returns the score of the current document. Initially invalid, until
{@link #next()} is called the first time.
|
public abstract boolean | skipTo(int target)Skips to the first match beyond the current whose document number is
greater than or equal to target. 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.
|