Skip to content

Utilize docIdRunEnd on ReqExclBulkScorer #14806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ Optimizations

* GITHUB#14774: Use IntArrayList/IntHashSet to replace usages of List/Set of Integer. (Zhang Chao)

* GITHUB#14806: Utilize docIdRunEnd on ReqExclBulkScorer. (Ge Song)

Bug Fixes
---------------------
* GITHUB#14654: ValueSource.fromDoubleValuesSource(dvs).getSortField() would throw errors when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public int score(LeafCollector collector, Bits acceptDocs, int min, int max) thr
exclDoc = exclApproximation.advance(upTo);
}
if (exclDoc == upTo) {
if (exclTwoPhase == null || exclTwoPhase.matches()) {
if (exclTwoPhase == null) {
// from upTo to docIdRunEnd() are excluded, so we scored up to docIdRunEnd()
upTo = exclApproximation.docIDRunEnd();
} else if (exclTwoPhase.matches()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is upTo = Math.max(upTo + 1, exclTwoPhase.docIdRunEnd()) correct here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's correct here, and I run lucene test locally, everything looks fine. What I'm concerned here is that only DocValuesRangeIterator implement it's own docIdRunEnd method for now, I'm not sure whether adding this will hurt the performance or not

// upTo is excluded so we can consider that we scored up to upTo+1
upTo += 1;
}
Expand Down