|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.Scorer
org.apache.lucene.search.ReqOptSumScorer
public class ReqOptSumScorer
A Scorer for queries with a required part and an optional part.
Delays skipTo() on the optional part until a score() is needed.
This Scorer
implements Scorer.skipTo(int)
.
Constructor Summary | |
---|---|
ReqOptSumScorer(Scorer reqScorer,
Scorer optScorer)
Construct a ReqOptScorer . |
Method Summary | |
---|---|
int |
doc()
Returns the current document number matching the query. |
Explanation |
explain(int doc)
Explain the score of a document. |
boolean |
next()
Advances to the next document matching the query. |
float |
score()
Returns the score of the current document matching the query. |
boolean |
skipTo(int target)
Skips to the first match beyond the current whose document number is greater than or equal to a given target. |
Methods inherited from class org.apache.lucene.search.Scorer |
---|
getSimilarity, score, score |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReqOptSumScorer(Scorer reqScorer, Scorer optScorer)
ReqOptScorer
.
reqScorer
- The required scorer. This must match.optScorer
- The optional scorer. This is used for scoring only.Method Detail |
---|
public boolean next() throws java.io.IOException
Scorer
next
in class Scorer
Scorer.explain(int)
method should not be used.
java.io.IOException
public boolean skipTo(int target) throws java.io.IOException
Scorer
Scorer.explain(int)
method should not be used.
skipTo
in class Scorer
target
- The target document number.
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.
java.io.IOException
public int doc()
Scorer
Scorer.next()
is called the first time.
doc
in class Scorer
public float score() throws java.io.IOException
next()
is called the first time.
score
in class Scorer
java.io.IOException
public Explanation explain(int doc) throws java.io.IOException
explain
in class Scorer
doc
- The document number for the explanation.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |