Module org.apache.lucene.join
Package org.apache.lucene.search.join
Class ToParentBlockJoinQuery.BlockJoinBulkScorer
java.lang.Object
org.apache.lucene.search.BulkScorer
org.apache.lucene.search.join.ToParentBlockJoinQuery.BlockJoinBulkScorer
- Enclosing class:
ToParentBlockJoinQuery
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BulkScorer
private final BitSet
private final int
private final ScoreMode
-
Constructor Summary
ConstructorsConstructorDescriptionBlockJoinBulkScorer
(BulkScorer childBulkScorer, BitSet parents, ScoreMode scoreMode) -
Method Summary
Modifier and TypeMethodDescriptionlong
cost()
Same asDocIdSetIterator.cost()
for bulk scorers.int
score
(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 int
scoringCompleteCheck
(int innerMax, int returnedMax) wrapCollector
(LeafCollector collector) Methods inherited from class org.apache.lucene.search.BulkScorer
score
-
Field Details
-
childBulkScorer
-
scoreMode
-
parents
-
parentsLength
private final int parentsLength
-
-
Constructor Details
-
BlockJoinBulkScorer
-
-
Method Details
-
score
Description copied from class:BulkScorer
Collects 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_DOCS
if there are no more matches,- <= the first matching document that is >=
max
otherwise.
min
is the minimum document to be considered for matching. All documents strictly before this value must be ignored.Although
max
would 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:
score
in classBulkScorer
- Parameters:
collector
- The collector to which all matching documents are passed.acceptDocs
-Bits
that represents the allowed documents to match, ornull
if 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
- >=
-
scoringCompleteCheck
private int scoringCompleteCheck(int innerMax, int returnedMax) -
cost
public long cost()Description copied from class:BulkScorer
Same asDocIdSetIterator.cost()
for bulk scorers.- Specified by:
cost
in classBulkScorer
-
wrapCollector
-