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

Fix requests for object-type fields #25610

Closed
wants to merge 1 commit into from
Closed

Conversation

dyst5422
Copy link

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 strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

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.
@elasticmachine
Copy link
Contributor

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?

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@spalger spalger added the review label Jun 28, 2019
@lukasolson
Copy link
Member

Related to #25068.

Copy link
Member

@lukasolson lukasolson left a 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!

@lukasolson lukasolson added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:Stack Services labels Jul 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-services

@bmcconaghy
Copy link
Contributor

@tsullivan @joelgriffith can one of you take a look at this one?

@stacey-gammon
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants