-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Ensure fetch fields aren't dropped when rewriting search. #61383
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
Ensure fetch fields aren't dropped when rewriting search. #61383
Conversation
Previously we didn't retain the requested fields when performing a shallow copy of the search source. This meant that when a search was rewritten, we could drop the requested fields and fail to return them in the response.
Pinging @elastic/es-search (:Search/Search) |
I've marked this as 'non-issue' because it wasn't released. For context, @astefan discovered this bug through the SQL test suites. |
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.
Good catch, thanks for adding the shallow copy test.
public void testShallowCopy() { | ||
SearchSourceBuilder original = createSearchSourceBuilder(); | ||
SearchSourceBuilder copy = original.shallowCopy(); | ||
assertEquals(original, copy); |
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.
++, maybe run few iterations to catch more cases ?
@elasticmachine run elasticsearch-ci/packaging-sample-windows |
Thanks @jimczi for the review. |
The skip can be removed now that #61383 is backported.
Previously we didn't retain the requested fields when performing a shallow copy
of the search source. This meant that when a search was rewritten, we could drop
the requested fields and fail to return them in the response.