[index_pattern_management]: Replace calls to /elasticsearch/_msearch with internal route.#77564
Conversation
There was a problem hiding this comment.
I hardcoded painless here because we removed support for expression based scripted fields awhile ago, thus eliminating the ability to edit existing scripted fields. As a result there was really no point in passing the lang around, since you already can't preview a legacy expression scripted field anyway.
There was a problem hiding this comment.
Restructured the response to minimize the amount of changes I needed to make to the existing types that the UI relies on.
There was a problem hiding this comment.
Logic here was mostly ripped off from the existing code on the client, with some slight modifications.
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
pgayvallet
left a comment
There was a problem hiding this comment.
Thanks a lot for doing this, it will unblock #71927 and allow to finally get rid of the legacy es plugin!
0846a09 to
7ccbac3
Compare
mattkime
left a comment
There was a problem hiding this comment.
code looks good and works well.
💚 Build SucceededBuild metricsasync chunks size
distributable file count
History
To update your PR or re-run it, just comment with: |
…` with internal route. (elastic#77564)
Closes #73993
Related to #55140
Summary
This removes the final usage of the
/elasticsearch/_msearchendpoint in Kibana. It was being used by the Index Pattern Management UI when generating previews of scripted field results in the field editor.Changes include the following:
preview_scripted_fieldroute that's internal to theindex_pattern_managementplugin_searchinstead of_msearch, as I couldn't find any reason why_msearchwas actually necessary here (though I tested it with our recently added internal_msearchroute and it still worked)routesdirectory inindex_pattern_managementand consolidates existingresolve_indexroute there as well.Testing
No functional changes introduced here. To test, create a new scripted field and click the "preview" link from the editor. If the script is invalid, an error should be shown in the preview flyout, otherwise a preview should display as it did before.