-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Remove empty results before merging #126770
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
Merged
javanna
merged 11 commits into
elastic:main
from
javanna:fix/merge_remove_empty_results
Apr 17, 2025
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e7cf1e9
Remove empty results before merging
javanna c794c6d
Update docs/changelog/126770.yaml
javanna 5145707
[CI] Auto commit changes from spotless
elasticsearchmachine 810fd02
iter
javanna b5d6880
iter
javanna d8cc823
Merge branch 'main' into fix/merge_remove_empty_results
javanna 3d1b7d1
iter
javanna b07b03f
Merge branch 'main' into fix/merge_remove_empty_results
javanna fc3725c
transport version
javanna cc8abed
Merge branch 'main' into fix/merge_remove_empty_results
javanna 6437e5e
iter
javanna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 126770 | ||
summary: Remove empty results before merging | ||
area: Search | ||
type: bug | ||
issues: | ||
- 126742 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@original-brownbear can you keep me honest here? the filtering broke the field collapsing tests, I removed it entirely here (see TopFieldGroups#merge). We basically can't deal with empty top docs in there, so we can only assert that that scenario does not present. Is that the case in practice?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure we can do that, can't we deal with this case by simply returning
null
here like we did before if the resultingshardTopDocs
after filtering are an empty array? (I think there's cases where this can legitimately be empty looking atorg.elasticsearch.lucene.grouping.SinglePassGroupingCollector#getTopGroups
for example?)All of that said, I'm really starting to think I simply did a bit of a bad job here upstream. If we simply don't pass the empty top docs into this method ever (like we used to without data node side batching) then we would simply return
null
out of the box and behavior is unchanged. But for a quick fix, returningnull
should do the trick?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the null handling one more time, and it seems to work this time. I had to add a bunch of odd null checks, but at least we can now distinguish between proper empty top docs and our own placeholder.