Fix new terms enum API when field meta is not passed for autocomplete value suggestions#104141
Merged
dej611 merged 2 commits intoelastic:masterfrom Jul 6, 2021
Merged
Conversation
streamich
approved these changes
Jul 1, 2021
Contributor
streamich
left a comment
There was a problem hiding this comment.
LGTM, approving to unblock this fix, would be great if somebody from data plugin would still give it a look. @elastic/kibana-app-services
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 6, 2021
… value suggestions (elastic#104141) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Jul 6, 2021
… value suggestions (elastic#104141) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related to #100174
In Lens Formula we use the KQL autocomplete suggestion system via the
data.autocompleteplugin.Because Lens remaps the indexpattern object structure in its own format, the
toSpec()method used to provide field metadata to the autocomplete endpoint is not available, and the only information passed areindexpatternandfieldName.The Formula suggestion system started returning HTTP 500 errors and the root problem was traced back to #100174 .
The new terms enum API introduced the wrong fallback in case of no field provided, and this PR makes it use the
fieldNameone (as for the terms agg).I've added also basic unit tests on both functions to cover the absence of
fieldmetadata.Checklist
Delete any items that are not applicable to this PR.
For maintainers