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

[Lens] Show runtime fields in field list and improve performance #79167

Merged
merged 4 commits into from
Oct 2, 2020

Conversation

wylieconlon
Copy link
Contributor

@wylieconlon wylieconlon commented Oct 1, 2020

The reason runtime fields were not being shown is that their values aren't available in _source. There was existing tech debt to move away from _source and towards fields, so this PR both fixes a bug and cleans up tech debt. By using fields, we remove the following special handling:

  • Runtime fields are automatically returned
  • Multi-mapped field like .keyword are automatically handled
  • Alias fields are automatically handled
  • All keys are turned into dotted strings, removing any need for recursive checks

As a result, we can support field existence queries on cross-cluster search, and remove the extra calls to mapping and field_caps.

Fixes #78171
Closes #56902
Closes #72012

Checklist

@wylieconlon wylieconlon added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 Feature:Lens v7.10.0 labels Oct 1, 2020
@wylieconlon wylieconlon requested review from dej611, flash1293, mbondyra and a team October 1, 2020 16:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@@ -22,7 +22,6 @@ const fieldsWithData = [
'@timestamp',
'_id',
'_index',
'_source',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

_source was removed from the API response, but this has no effect on Lens because it was hidden anyway.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Chrome and works as expected, LGTM. Meta fields still work fine, script fields still work fine, fields are correctly reported as empty.

Didn't test cross-cluster search

@wylieconlon wylieconlon merged commit 374ccfd into elastic:master Oct 2, 2020
@wylieconlon wylieconlon deleted the lens/simplify-existence branch October 2, 2020 18:18
wylieconlon pushed a commit that referenced this pull request Oct 5, 2020
#79167) (#79340)

* [Lens] Show runtime fields in field list and improve performance (#79167)

* [Lens] Simplify request to determine existing fields

* Remove duplicate values
# Conflicts:
#	x-pack/test/api_integration/apis/lens/existing_fields.ts

* Fix merge issue

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
4 participants