…SORT` autocomplete routines (#197744) (#198159)
# Backport
This will backport the following commits from `main` to `8.x`:
- [[ES|QL] separate `KEEP`, `DROP`, and
`SORT` autocomplete routines
(#197744)](#197744)
<!--- Backport version: 9.4.3 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2024-10-29T15:50:30Z","message":"[ES|QL]
separate `KEEP`, `DROP`, and `SORT` autocomplete routines
(#197744)\n\n## Summary\r\n\r\nThis PR begins the refactor described
in\r\nhttps://github.com//issues/195418.\r\n\r\nThe
autocomplete engine now delegates to command-specific
routines\r\nattached to the command definitions for `KEEP`, `DROP`, and
`SORT`.\r\n\r\nThe naming of `getFieldsFor` has been broadened to
`getColumnsFor`\r\nbecause the response from Elasticsearch can contain
variables as well as\r\nfields, depending on the query that is used to
fetch the columns.\r\n\r\nNo user-facing behavior should have
changed.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"11ae6a5bd9a06a4402e8af5173b0b0efcf5f52fc","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Feature:ES|QL","Team:ESQL","backport:version","v8.17.0"],"title":"[ES|QL]
separate `KEEP`, `DROP`, and `SORT` autocomplete
routines","number":197744,"url":"https://github.com/elastic/kibana/pull/197744","mergeCommit":{"message":"[ES|QL]
separate `KEEP`, `DROP`, and `SORT` autocomplete routines
(#197744)\n\n## Summary\r\n\r\nThis PR begins the refactor described
in\r\nhttps://github.com//issues/195418.\r\n\r\nThe
autocomplete engine now delegates to command-specific
routines\r\nattached to the command definitions for `KEEP`, `DROP`, and
`SORT`.\r\n\r\nThe naming of `getFieldsFor` has been broadened to
`getColumnsFor`\r\nbecause the response from Elasticsearch can contain
variables as well as\r\nfields, depending on the query that is used to
fetch the columns.\r\n\r\nNo user-facing behavior should have
changed.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"11ae6a5bd9a06a4402e8af5173b0b0efcf5f52fc"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197744","number":197744,"mergeCommit":{"message":"[ES|QL]
separate `KEEP`, `DROP`, and `SORT` autocomplete routines
(#197744)\n\n## Summary\r\n\r\nThis PR begins the refactor described
in\r\nhttps://github.com//issues/195418.\r\n\r\nThe
autocomplete engine now delegates to command-specific
routines\r\nattached to the command definitions for `KEEP`, `DROP`, and
`SORT`.\r\n\r\nThe naming of `getFieldsFor` has been broadened to
`getColumnsFor`\r\nbecause the response from Elasticsearch can contain
variables as well as\r\nfields, depending on the query that is used to
fetch the columns.\r\n\r\nNo user-facing behavior should have
changed.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"11ae6a5bd9a06a4402e8af5173b0b0efcf5f52fc"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Co-authored-by: Drew Tate <drew.tate@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Summary
This PR begins the refactor described in #195418.
The autocomplete engine now delegates to command-specific routines attached to the command definitions for
KEEP,DROP, andSORT.The naming of
getFieldsForhas been broadened togetColumnsForbecause the response from Elasticsearch can contain variables as well as fields, depending on the query that is used to fetch the columns.No user-facing behavior should have changed.
Checklist