Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search Source] Update search source to use minimal data view spec fo…
…r serialization (elastic#169460) ## Summary Currently we use the full data view spec whenever we serialize fields for a search source with an ad hoc data view, except when otherwise specified (currently only when serializing for alert URLs). As a result, whenever we persist a serialized search source containing an ad hoc data view within a saved object, we end up persisting the entire data view field list as well. For data views that target hundreds or thousands of fields, this can result in huge saved objects that exceed Kibana's max payload size, causing issues like the one seen in elastic#168573. Does it ever make sense to persist the full data view spec now that we have a minimal spec (strips all field list data except popularity counts, custom labels, etc.)? I don't think it does, so this PR updates search source to always use the minimal data view spec for ad hoc data views, limiting the impact of large field lists. Barring a good reason not to do this, I think we should make this the standard behaviour. Fixes elastic#168573. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information