Skip to content

Replace SimpleCollector driver with explicit leaf iteration in QueryUtils#16266

Merged
javanna merged 6 commits into
apache:mainfrom
javanna:query_utils_no_search
Jun 30, 2026
Merged

Replace SimpleCollector driver with explicit leaf iteration in QueryUtils#16266
javanna merged 6 commits into
apache:mainfrom
javanna:query_utils_no_search

Conversation

@javanna

@javanna javanna commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Remove the deprecated IndexSearcher#search(Query, Collector) call.
Rather than introducing collector managers, which add in this case
unwanted complexity, the search call can be replaced by a loop over the leaves.

SimpleCollector wrapper is gone; a for-loop over leaf contexts and a
while-loop over matching documents are now the explicit driver.

Relates to #12892

javanna added 2 commits June 17, 2026 15:34
Create outerWeight/shadowWeight before the search call so they are ready
for the loop, eliminating the per-leaf weight creation inside collect().
Replace leafPtr with a currentLeafContext field set in doSetNextReader.
Move opidx to an instance field. Rename the outer Scorable field to
outerScorer to avoid a future name collision with the shadow Scorer.
No behaviour change.
…tils

Remove the deprecated IndexSearcher#search(Query, Collector) call. The
SimpleCollector wrapper is gone; a for-loop over leaf contexts and a
while-loop over matching documents are now the explicit driver. The only
content changes are the array-wrapper removals (lastDoc[0] → lastDoc,
lastReader[0] → lastReader) and the outer try-catch, both unavoidable
consequences of removing the anonymous class.
@javanna javanna added this to the 10.5.0 milestone Jun 17, 2026
@javanna

javanna commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

I plan on merging this soon, please have a look if you get a chance!

@romseygeek romseygeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@javanna javanna merged commit cf72e8d into apache:main Jun 30, 2026
13 checks passed
@javanna

javanna commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @romseygeek !

javanna added a commit that referenced this pull request Jun 30, 2026
…tils (#16266)

Remove the deprecated `IndexSearcher#search(Query, Collector)` call.
Rather than introducing collector managers, which add in this case 
unwanted complexity, the search call can be replaced by a loop over the leaves.

`SimpleCollector` wrapper is gone; a for-loop over leaf contexts and a
while-loop over matching documents are now the explicit driver. 

Relates to #12892
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