Skip to content
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

Fork FirstPassGroupingCollector into a custom single pass collector #79224

Merged
merged 3 commits into from
Oct 20, 2021

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Oct 15, 2021

This change rewrites the CollapsingTopDocsCollector into a
SinglePassGroupingCollector.
Relying on Lucene's FirstPassGroupingCollector is not safe,
we have no guarantee that the underlying implementation will
not break our custom extension in the future.
It is also a blocker for the modularization of Elasticsearch
since the extension class needs to access a Lucene's package
protected field.
So this commit forks the code of the FirstPassGroupingCollector
into a specialized collector that we can control.

This change rewrites the CollapsingTopDocsCollector into a
SinglePassGroupingCollector.
Relying on Lucene's FirstPassGroupingCollector is not safe,
we have no guarantee that the underlying implementation will
not break our custom extension in the future.
It is also a blocker for the modularization of Elasticsearch
since the extension class needs to access a Lucene's package
protected field.
So this commit forks the code of the FirstPassGroupingCollector
into a specialized collector that we can control.
@jimczi jimczi added >non-issue :Search/Search Search-related issues that do not fall into other categories v8.0.0 labels Oct 15, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Oct 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

This looks great @jimczi, thanks for taking it on. Much appreciated. ( please wait for a second more knowledgable area-specific reviewer )

Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM.

Do we want to contribute the SinglePassGroupingCollector back upstream? It seems to be a generally useful class that isn't coupled to any ES-specific code AIUI

@jimczi jimczi merged commit b0a829e into elastic:master Oct 20, 2021
@jimczi jimczi deleted the field_collapsing_collector branch October 20, 2021 13:54
@ChrisHegarty ChrisHegarty mentioned this pull request Nov 1, 2021
58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants