-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix requests for object-type fields #25610
Conversation
Currently, the export to CSV functionality resuses the request from the page location. This adds all fields that are not script fields to the stored_fields on the request. This breaks the request for non-leaf fields (object-type fields) and causes the export to fail. As per the note at the top of https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-stored-fields.html it seems like the stored_fields approach is not encouraged as is. Fields returned are already filtered with the _source.includes. Perhaps this should still add fields in to the store_fields but check to make sure they are leaf fields first. This fix stops adding to the stored_fields and thus fixes export for non-leaf fields.
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
Pinging @elastic/kibana-app-arch |
Related to #25068. |
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.
Firstly, sorry this has flown under the radar for so long.
Please take a look at my comment here.
While this fixes the scenario where you're attempting to query an object field that is not a leaf (but is stored in _source
), it does not address the scenario where _source
is disabled and you're trying to query a field that is stored. I've posted a suggested solution in the comment linked to above that may address this. If you'd like to update this PR with that suggestion, that'd be great! Otherwise I think we should probably close this PR in favor of opening a new one with the suggested solution.
Thanks for contributing!
Pinging @elastic/kibana-stack-services |
@tsullivan @joelgriffith can one of you take a look at this one? |
Given no response, I'm going to close this. Thanks for your interest in contributing @dyst5422 and apologies it took us so long to respond. If you are interested in picking this back up, please take a look at @lukasolson's comment and re-open. |
Currently, the export to CSV functionality resuses the request from the page location. This adds all fields that are not script fields to the stored_fields on the request. This breaks the request for non-leaf fields (object-type fields) and causes the export to fail.
As per the note at the top of https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-stored-fields.html it seems like the stored_fields approach is not encouraged as is. Fields returned are already filtered with the _source.includes.
Perhaps this should still add fields in to the store_fields but check to make sure they are leaf fields first.
This fix stops adding to the stored_fields and thus fixes export for non-leaf fields.
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers