org.apache.lucene.search

Class ReqOptSumScorer

public class ReqOptSumScorer extends Scorer

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 {@link Scorer#skipTo(int)}.
Constructor Summary
ReqOptSumScorer(Scorer reqScorer, Scorer optScorer)
Construct a ReqOptScorer.
Method Summary
intdoc()
Explanationexplain(int doc)
Explain the score of a document.
booleannext()
floatscore()
Returns the score of the current document matching the query.
booleanskipTo(int target)

Constructor Detail

ReqOptSumScorer

public ReqOptSumScorer(Scorer reqScorer, Scorer optScorer)
Construct a ReqOptScorer.

Parameters: reqScorer The required scorer. This must match. optScorer The optional scorer. This is used for scoring only.

Method Detail

doc

public int doc()

explain

public Explanation explain(int doc)
Explain the score of a document.

UNKNOWN: Also show the total score. See BooleanScorer.explain() on how to do this.

next

public boolean next()

score

public float score()
Returns the score of the current document matching the query. Initially invalid, until {@link #next()} is called the first time.

Returns: The score of the required scorer, eventually increased by the score of the optional scorer when it also matches the current document.

skipTo

public boolean skipTo(int target)
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.