Skip to content

Fix new terms enum API when field meta is not passed for autocomplete value suggestions#104141

Merged
dej611 merged 2 commits intoelastic:masterfrom
dej611:fix/terms_enum_suggestion
Jul 6, 2021
Merged

Fix new terms enum API when field meta is not passed for autocomplete value suggestions#104141
dej611 merged 2 commits intoelastic:masterfrom
dej611:fix/terms_enum_suggestion

Conversation

@dej611
Copy link
Contributor

@dej611 dej611 commented Jul 1, 2021

Summary

Related to #100174

In Lens Formula we use the KQL autocomplete suggestion system via the data.autocomplete plugin.
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 are indexpattern and fieldName.
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 fieldName one (as for the terms agg).

I've added also basic unit tests on both functions to cover the absence of field metadata.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dej611 dej611 added Feature:Filters Feature:KQL KQL Team:AppServices release_note:skip Skip the PR/issue when compiling release notes v7.14.0 auto-backport Deprecated - use backport:version if exact versions are needed v7.15.0 labels Jul 1, 2021
@dej611 dej611 requested a review from a team as a code owner July 1, 2021 16:26
Copy link
Contributor

@streamich streamich left a comment

Choose a reason for hiding this comment

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

LGTM, approving to unblock this fix, would be great if somebody from data plugin would still give it a look. @elastic/kibana-app-services

@dej611
Copy link
Contributor Author

dej611 commented Jul 5, 2021

@elasticmachine merge upstream

@dej611 dej611 added the v8.0.0 label Jul 5, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@dej611 dej611 merged commit f6fc6c1 into elastic:master Jul 6, 2021
@dej611 dej611 deleted the fix/terms_enum_suggestion branch July 6, 2021 12:36
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>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.14
7.x

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jul 6, 2021
… value suggestions (#104141) (#104430)

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

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jul 6, 2021
… value suggestions (#104141) (#104429)

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

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed Feature:Filters Feature:KQL KQL release_note:skip Skip the PR/issue when compiling release notes v7.14.0 v7.15.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants