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

[SearchSource] Combine sort and parent fields when serializing #89808

Merged
merged 7 commits into from Feb 2, 2021

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Jan 29, 2021

Summary

This PR provides a step towards making CSV Export pass a serialized SearchSource when requesting to generate a CSV report.

Previously, calling getSerializedFields would return just the fields of the SearchSource instance, and doesn't reference any parent search source.

In this PR, passing true to getSerializedFields will reference all fields of the parent search sources by recursively nagivating up the hierarchy.

Another issue solved in this PR is that the sort field of a search source needed special deserialization so that it can be part of the serialized fields.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@tsullivan tsullivan requested a review from a team as a code owner January 29, 2021 23:32
@tsullivan tsullivan added release_note:skip Skip the PR/issue when compiling release notes Team:AppServices v7.12.0 v8.0.0 labels Jan 29, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@@ -49,6 +49,10 @@ function normalize(
}
}

// FIXME: for unknown reason on the server this setting is serialized
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we create an issue for this and link it here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@tsullivan
Copy link
Member Author

Note there has been one small change since this PR was reviewed: eef541c

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 798.4KB 799.7KB +1.3KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan tsullivan merged commit ad67ee5 into elastic:master Feb 2, 2021
@tsullivan tsullivan deleted the searchsource/getfields-recurse branch February 2, 2021 17:15
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 2, 2021
…ic#89808)

* [SearchSource] Combine sort and parent fields when serializing

* fix docs

* add link to issue
;

* fix destructive recursion

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
phillipb added a commit to phillipb/kibana that referenced this pull request Feb 2, 2021
…-ml-jobs

* 'master' of github.com:elastic/kibana: (254 commits)
  [Security Solution] [Detections] Remove allow_no_indices to prevent error being thrown in response of field capabilities (elastic#89927)
  Skip test for cloud (elastic#89450)
  [Fleet] Fix duplicate data streams being shown in UI (elastic#89812)
  Bump package dependencies (elastic#90034)
  [App Search] DRY helper for encoding/decoding routes that can have special characters in params (elastic#89811)
  TypeScript project references for Observability plugin (elastic#89320)
  [SearchSource] Combine sort and parent fields when serializing (elastic#89808)
  Made imports static (elastic#89935)
  [ml] migrate file_data_visualizer/import route to file_upload plugin (elastic#89640)
  [Discover] Adapt default column behavior (elastic#89826)
  Round start and end values (elastic#89030)
  Rename getProxyAgents to getCustomAgents (elastic#89813)
  [Form lib] UseField `onError` listener (elastic#89895)
  [APM] use latency sum instead of avg for impact (elastic#89990)
  migrate more core-owned plugins to tsproject ref (elastic#89975)
  [Logs UI] Load <LogStream> entries via async searches (elastic#86899)
  [APM] Abort browser requests when appropriate (elastic#89557)
  [Alerting] Allow user to select existing connector of same type when fixing broken connector (elastic#89062)
  [Data Table] Use shared CSV export mechanism (elastic#89702)
  chore(NA): improve logic check when installing Bazel tools (elastic#89634)
  ...
tsullivan added a commit that referenced this pull request Feb 2, 2021
… (#90046)

* [SearchSource] Combine sort and parent fields when serializing

* fix docs

* add link to issue
;

* fix destructive recursion

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants