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

Revert "Remove shortcutTotalHitCount optimization" #94876

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Mar 29, 2023

Reverts #89047

We have removed shortcut total hit count with #89047 and later noticed a couple of benchmark regressions. This PR reverts such change and reinstates the original logic for shortcut total hit count.

For the case where hits are collected, the total hit count is incremented as part of the collection in TopScoreDocCollector and TopFieldCollector, where Lucene does not support skipping the counting based on Weight#count. The previous change caused a regression specifically when collecting hits because we ended up removing our manual shortcut in favour of counting which causes overhead (the idea was rather to replace our own shortcutting mechanism with that from Lucene, which is though not extensive yet).

@javanna javanna added >non-issue :Search/Search Search-related issues that do not fall into other categories v8.8.0 labels Mar 29, 2023
@javanna javanna requested a review from dnhatn March 29, 2023 16:39
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Mar 29, 2023
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @javanna.

@javanna javanna merged commit 3019796 into main Mar 29, 2023
@javanna javanna deleted the revert-89047-refactoring/remove_shortcut_total_hit_count branch March 29, 2023 17:48
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.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants