protected class ConstantScoreQuery.ConstantScorer extends Scorer
Constructor and Description |
---|
ConstantScoreQuery.ConstantScorer(Similarity similarity,
IndexReader reader,
Weight w) |
Modifier and Type | Method and Description |
---|---|
int |
doc()
Returns the current document number.
|
Explanation |
explain(int doc)
Returns an explanation of the score for a document.
|
boolean |
next()
Moves to the next docId in the set.
|
float |
score()
Returns the score of the current document matching the query.
|
boolean |
skipTo(int target)
Skips entries to the first beyond the current whose document number is
greater than or equal to target.
|
getSimilarity, score, score
public ConstantScoreQuery.ConstantScorer(Similarity similarity, IndexReader reader, Weight w) throws IOException
IOException
public boolean next() throws IOException
DocIdSetIterator
next
in class DocIdSetIterator
IOException
public int doc()
DocIdSetIterator
This is invalid until DocIdSetIterator.next()
is called for the first time.
doc
in class DocIdSetIterator
public float score() throws IOException
Scorer
DocIdSetIterator.next()
or DocIdSetIterator.skipTo(int)
is called the first time.score
in class Scorer
IOException
public boolean skipTo(int target) throws IOException
DocIdSetIterator
Returns true iff there is such an entry.
Behaves as if written:
boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; }Some implementations are considerably more efficient than that.
skipTo
in class DocIdSetIterator
IOException
public Explanation explain(int doc) throws IOException
Scorer
DocIdSetIterator.next()
, DocIdSetIterator.skipTo(int)
and
Scorer.score(HitCollector)
methods should not be used.explain
in class Scorer
doc
- The document number for the explanation.IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.