-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Search] The csv_searchsource
export type requests all the fields when just a few are needed
#123187
Comments
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
csv_searchsource
export type requests all the fields when just a few are needed csv_searchsource
export type requests all the fields when just a few are needed
I don't believe we should be reusing this behavior from Discover's search source configuration. Currently, Discover sets the It seems that, instead, when generating the CSV, we should look at the list of columns configured and use |
Thanks @lukasolson CSV Export gets its search source configuration, and a separate list of columns, from here:
That is possible, but there is not always a list of columns configured (default "new search"). When there is, it comes from the Discover app state. When the user has not selected any fields, CSV export should export all of the fields. It sounds like we can't optimize that scenario very well, but is still worth discussion. Maybe we can make the list available in |
Do we have access to the |
@lukasolson I can't add to your faultless advice. In so far as the export is created from a data view context, using the data view will provide the most consistent experience. |
With your help, I took at stab and implementing this on the server side before CSV Export gets the search body: https://github.com/elastic/kibana/pull/123412/files#diff-a86296d9011252ff17c1007bb3de66763c43af633f7daff1207151da34838e7fR309 I floated this change by @dokmic and he convinced me this feels pretty hacky.
This seems to be the reason why Reporting has to add on a hack to "fix" the search source. The function that you linked to describes itself as a Edit: it looks like Discover does not have access to the fields/columns within the |
Closed in #123412 |
The original issue popped up in the reporting for CSV export type.
The current implementation of the CSV generator is reusing the request body of the search source. The body always contains
stored_fields: ['*']
and a field with*
infields
. That is causing the excessive gathering of all the available fields even though they are not exported.That problem significantly slows down the CSV generation on large datasets and increases memory consumption by the reporting.
In the
stored_fields
documentation, it is recommended to load those fields selectively.Should we fix that in the
search_source
object to return a request body fromgetSearchRequestBody
to fetch only selected fields? Namely:{ field: '*' }
from thefields
?stored_fields
value different from['*']
?The text was updated successfully, but these errors were encountered: