Methods Summary |
---|
public int | doc()
return reqScorer.doc();
|
public org.apache.lucene.search.Explanation | explain(int doc)Explain the score of a document.
Explanation res = new Explanation();
res.setDescription("required, optional");
res.addDetail(reqScorer.explain(doc));
res.addDetail(optScorer.explain(doc));
return res;
|
public boolean | next()
return reqScorer.next();
|
public float | score()Returns the score of the current document matching the query.
Initially invalid, until {@link #next()} is called the first time.
int curDoc = reqScorer.doc();
float reqScore = reqScorer.score();
if (firstTimeOptScorer) {
firstTimeOptScorer = false;
if (! optScorer.skipTo(curDoc)) {
optScorer = null;
return reqScore;
}
} else if (optScorer == null) {
return reqScore;
} else if ((optScorer.doc() < curDoc) && (! optScorer.skipTo(curDoc))) {
optScorer = null;
return reqScore;
}
// assert (optScorer != null) && (optScorer.doc() >= curDoc);
return (optScorer.doc() == curDoc)
? reqScore + optScorer.score()
: reqScore;
|
public boolean | skipTo(int target)
return reqScorer.skipTo(target);
|