| java.lang.Object org.apache.lucene.search.Scorer org.apache.lucene.search.BooleanScorer2
BooleanScorer2 | class BooleanScorer2 extends Scorer (Code) | | An alternative to BooleanScorer that also allows a minimum number
of optional scorers that should match.
Implements skipTo(), and has no limitations on the numbers of added scorers.
Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer.
|
Constructor Summary | |
public | BooleanScorer2(Similarity similarity, int minNrShouldMatch, boolean allowDocsOutOfOrder) Create a BooleanScorer2.
Parameters: similarity - The similarity to be used. Parameters: minNrShouldMatch - The minimum number of optional added scorersthat should match during the search.In case no required scorers are added,at least one of the optional scorers will have tomatch during the search. Parameters: allowDocsOutOfOrder - Whether it is allowed to return documents out of order.This can accelerate the scoring of disjunction queries. | public | BooleanScorer2(Similarity similarity, int minNrShouldMatch) Create a BooleanScorer2. | public | BooleanScorer2(Similarity similarity) Create a BooleanScorer2. |
Method Summary | |
public void | add(Scorer scorer, boolean required, boolean prohibited) | public int | doc() | public Explanation | explain(int doc) Throws an UnsupportedOperationException. | public boolean | next() | 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.
Note that
BooleanScorer2.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. | public float | score() | 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
BooleanScorer2.explain(int) method should not be used.
Parameters: target - The target document number. |
BooleanScorer2 | public BooleanScorer2(Similarity similarity, int minNrShouldMatch, boolean allowDocsOutOfOrder)(Code) | | Create a BooleanScorer2.
Parameters: similarity - The similarity to be used. Parameters: minNrShouldMatch - The minimum number of optional added scorersthat should match during the search.In case no required scorers are added,at least one of the optional scorers will have tomatch during the search. Parameters: allowDocsOutOfOrder - Whether it is allowed to return documents out of order.This can accelerate the scoring of disjunction queries. |
BooleanScorer2 | public BooleanScorer2(Similarity similarity, int minNrShouldMatch)(Code) | | Create a BooleanScorer2.
In no required scorers are added,
at least one of the optional scorers will have to match during the search.
Parameters: similarity - The similarity to be used. Parameters: minNrShouldMatch - The minimum number of optional added scorersthat should match during the search.In case no required scorers are added,at least one of the optional scorers will have tomatch during the search. |
BooleanScorer2 | public BooleanScorer2(Similarity similarity)(Code) | | Create a BooleanScorer2.
In no required scorers are added,
at least one of the optional scorers will have to match during the search.
Parameters: similarity - The similarity to be used. |
add | public void add(Scorer scorer, boolean required, boolean prohibited)(Code) | | |
explain | public Explanation explain(int doc)(Code) | | Throws an UnsupportedOperationException.
TODO: Implement an explanation of the coordination factor.
Parameters: doc - The document number for the explanation. throws: UnsupportedOperationException - |
score | protected boolean score(HitCollector hc, int max) throws IOException(Code) | | Expert: Collects matching documents in a range.
Note that
BooleanScorer2.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
BooleanScorer2.explain(int) method should not be used.
Parameters: target - The target document number. true iff there is such a match. |
|
|