| java.lang.Object org.apache.lucene.search.Scorer org.apache.lucene.search.DisjunctionSumScorer
DisjunctionSumScorer | class DisjunctionSumScorer extends Scorer (Code) | | A Scorer for OR like queries, counterpart of ConjunctionScorer .
This Scorer implements
Scorer.skipTo(int) and uses skipTo() on the given Scorers.
|
Field Summary | |
protected int | nrMatchers The number of subscorers that provide the current match. | final protected List | subScorers The subscorers. |
Constructor Summary | |
public | DisjunctionSumScorer(List subScorers, int minimumNrMatchers) Construct a DisjunctionScorer . | public | DisjunctionSumScorer(List subScorers) Construct a DisjunctionScorer , using one as the minimum number
of matching subscorers. |
Method Summary | |
protected boolean | advanceAfterCurrent() Advance all subscorers after the current document determined by the
top of the scorerDocQueue .
Repeat until at least the minimum number of subscorers match on the same
document and all subscorers are after that document or are exhausted.
On entry the scorerDocQueue has at least minimumNrMatchers
available. | public int | doc() | public Explanation | explain(int doc) An explanation for the score of a given document. | public boolean | next() | public int | nrMatchers() Returns the number of subscorers matching the current document. | public void | score(HitCollector hc) Scores and collects all matching documents. | protected boolean | score(HitCollector hc, int max) Expert: Collects matching documents in a range. | public float | score() Returns the score of the current document matching the query. | public boolean | skipTo(int target) Skips to the first match beyond the current whose document number is
greater than or equal to a given target.
When this method is used the
DisjunctionSumScorer.explain(int) method should not be used.
The implementation uses the skipTo() method on the subscorers.
Parameters: target - The target document number. |
nrMatchers | protected int nrMatchers(Code) | | The number of subscorers that provide the current match.
|
subScorers | final protected List subScorers(Code) | | The subscorers.
|
DisjunctionSumScorer | public DisjunctionSumScorer(List subScorers, int minimumNrMatchers)(Code) | | Construct a DisjunctionScorer .
Parameters: subScorers - A collection of at least two subscorers. Parameters: minimumNrMatchers - The positive minimum number of subscorers that shouldmatch to match this query. When minimumNrMatchers is bigger thanthe number of subScorers ,no matches will be produced. When minimumNrMatchers equals the number of subScorers,it more efficient to use ConjunctionScorer . |
DisjunctionSumScorer | public DisjunctionSumScorer(List subScorers)(Code) | | Construct a DisjunctionScorer , using one as the minimum number
of matching subscorers.
|
advanceAfterCurrent | protected boolean advanceAfterCurrent() throws IOException(Code) | | Advance all subscorers after the current document determined by the
top of the scorerDocQueue .
Repeat until at least the minimum number of subscorers match on the same
document and all subscorers are after that document or are exhausted.
On entry the scorerDocQueue has at least minimumNrMatchers
available. At least the scorer with the minimum document number will be advanced.
true iff there is a match. In case there is a match, currentDoc, currentSumScore,and nrMatchers describe the match. |
nrMatchers | public int nrMatchers()(Code) | | Returns the number of subscorers matching the current document.
Initially invalid, until
DisjunctionSumScorer.next() is called the first time.
|
score | protected boolean score(HitCollector hc, int max) throws IOException(Code) | | Expert: Collects matching documents in a range. Hook for optimization.
Note that
DisjunctionSumScorer.next() must be called once before this method is called
for the first time.
Parameters: hc - The collector to which all matching documents are passed throughHitCollector.collect(intfloat). Parameters: max - Do not score documents past this. true if more matching documents may remain. |
skipTo | public boolean skipTo(int target) throws IOException(Code) | | Skips to the first match beyond the current whose document number is
greater than or equal to a given target.
When this method is used the
DisjunctionSumScorer.explain(int) method should not be used.
The implementation uses the skipTo() method on the subscorers.
Parameters: target - The target document number. true iff there is such a match. |
|
|