java.lang.Object
org.apache.lucene.search.BulkScorer
org.apache.lucene.search.MaxScoreBulkScorer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final DisiWrapper[]private final longprivate final DisiPriorityQueue(package private) int(package private) int(package private) static final intprivate final int(package private) final double[](package private) floatprivate MaxScoreBulkScorer.ScoreAndDocprivate final DisiWrapper[]private final long[]private final double[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intcomputeOuterWindowMax(int windowMin) longcost()Same asDocIdSetIterator.cost()for bulk scorers.private intnextCandidate(int rangeEnd) Return the next candidate on or afterrangeEnd.(package private) booleanintscore(LeafCollector collector, Bits acceptDocs, int min, int max) Collects matching documents in a range and return an estimation of the next matching document which is on or aftermax.private voidscoreInnerWindow(LeafCollector collector, Bits acceptDocs, int max) private voidscoreInnerWindowAsConjunction(LeafCollector collector, Bits acceptDocs, int max) private voidscoreInnerWindowMultipleEssentialClauses(LeafCollector collector, Bits acceptDocs, int max) private voidscoreInnerWindowSingleEssentialClause(LeafCollector collector, Bits acceptDocs, int upTo) private voidscoreNonEssentialClauses(LeafCollector collector, int doc, double essentialScore, int numNonEssentialClauses) (package private) voidupdateMaxWindowScores(int windowMin, int windowMax) Methods inherited from class org.apache.lucene.search.BulkScorer
score
-
Field Details
-
INNER_WINDOW_SIZE
static final int INNER_WINDOW_SIZE- See Also:
-
maxDoc
private final int maxDoc -
allScorers
-
scratch
-
essentialQueue
-
firstEssentialScorer
int firstEssentialScorer -
firstRequiredScorer
int firstRequiredScorer -
cost
private final long cost -
minCompetitiveScore
float minCompetitiveScore -
scorable
-
maxScoreSums
final double[] maxScoreSums -
windowMatches
private final long[] windowMatches -
windowScores
private final double[] windowScores
-
-
Constructor Details
-
MaxScoreBulkScorer
MaxScoreBulkScorer(int maxDoc, List<Scorer> scorers) throws IOException - Throws:
IOException
-
-
Method Details
-
score
Description copied from class:BulkScorerCollects matching documents in a range and return an estimation of the next matching document which is on or aftermax.The return value must be:
- >=
max, DocIdSetIterator.NO_MORE_DOCSif there are no more matches,- <= the first matching document that is >=
maxotherwise.
minis the minimum document to be considered for matching. All documents strictly before this value must be ignored.Although
maxwould be a legal return value for this method, higher values might help callers skip more efficiently over non-matching portions of the docID space.For instance, a
Scorer-based implementation could look like below:private final Scorer scorer; // set via constructor public int score(LeafCollector collector, Bits acceptDocs, int min, int max) throws IOException { collector.setScorer(scorer); int doc = scorer.docID(); if (doc < min) { doc = scorer.advance(min); } while (doc < max) { if (acceptDocs == null || acceptDocs.get(doc)) { collector.collect(doc); } doc = scorer.nextDoc(); } return doc; }- Specified by:
scorein classBulkScorer- Parameters:
collector- The collector to which all matching documents are passed.acceptDocs-Bitsthat represents the allowed documents to match, ornullif they are all allowed to match.min- Score starting at, including, this documentmax- Score up to, but not including, this doc- Returns:
- an under-estimation of the next matching doc after max
- Throws:
IOException
- >=
-
scoreInnerWindow
- Throws:
IOException
-
scoreInnerWindowSingleEssentialClause
private void scoreInnerWindowSingleEssentialClause(LeafCollector collector, Bits acceptDocs, int upTo) throws IOException - Throws:
IOException
-
scoreInnerWindowAsConjunction
private void scoreInnerWindowAsConjunction(LeafCollector collector, Bits acceptDocs, int max) throws IOException - Throws:
IOException
-
scoreInnerWindowMultipleEssentialClauses
private void scoreInnerWindowMultipleEssentialClauses(LeafCollector collector, Bits acceptDocs, int max) throws IOException - Throws:
IOException
-
computeOuterWindowMax
- Throws:
IOException
-
updateMaxWindowScores
- Throws:
IOException
-
scoreNonEssentialClauses
private void scoreNonEssentialClauses(LeafCollector collector, int doc, double essentialScore, int numNonEssentialClauses) throws IOException - Throws:
IOException
-
partitionScorers
boolean partitionScorers() -
nextCandidate
private int nextCandidate(int rangeEnd) Return the next candidate on or afterrangeEnd. -
cost
public long cost()Description copied from class:BulkScorerSame asDocIdSetIterator.cost()for bulk scorers.- Specified by:
costin classBulkScorer
-