Skip to content

Partially revert Use intoBitSet to speed up ReqExclBulkScorer - #17083

Draft
Edarke wants to merge 3 commits into
apache:mainfrom
Edarke:edarke-fix-two-phase-exclusion-regression
Draft

Edarke wants to merge 3 commits into
apache:mainfrom
Edarke:edarke-fix-two-phase-exclusion-regression

Conversation

@Edarke

@Edarke Edarke commented Nov 25, 2026

Copy link
Copy Markdown

Description

While upgrading to Lucene 10.6, our internal perf testing flagged a regression in +term -"phrase query". Upon investigation, this seems that #16669 began eagerly requesting precise matches from the TwoPhaseIterator in ReqExclBulkScorer.java. This eager refinement works well for numeric queries, but regresses phrase queries which don't amortize costs as well.

Example of regressed queries

Query Metric Before (Lucene 10.5) Before (%) After (Lucene 10.6) After (%) Change Confidence
<+attorney -"of the"> count 637.79 0.0% 20.88 0.0% -96.7% (-96% – -96%) 1.000
<+attorney -"of the"> top 100 612.56 0.0% 20.83 0.0% -96.6% (-96% – -96%) 1.000
<+(attorney lawyer court) -"of the"> count 154.81 0.0% 19.56 0.0% -87.4% (-87% – -87%) 1.000
<+university -(+of -"in the")> top 100 98.87 0.0% 22.94 0.0% -76.8% (-76% – -76%) 1.000

This PR attempts to resolve these regressions while preserving the performance gains of #16669 as much as possible. Benchmarks to follow

@romseygeek

Copy link
Copy Markdown
Contributor

Thanks for opening @Edarke! I wonder if there is a way of doing this using the existing cost() API rather than via the a new method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants