-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[data.search] Clean up code around ES preference usage #204076
Conversation
…ana into search_cleanup_preference
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise it looks good to me.
src/plugins/data/common/search/search_source/fetch/get_search_params.ts
Outdated
Show resolved
Hide resolved
…params.ts Co-authored-by: Marco Vettorello <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-only review, LGTM 👍
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Page load bundle
History
cc @lukasolson |
Starting backport for target branches: 8.x |
## Summary While refreshing my memory on how we are using the Elasticsearch `preference` parameter, I noticed we had a method `getEsPreference` that was exported but not used. We then had an additional method `getPreference` that was being used to actually set the parameter. I consolidated these into one place and moved the tests so that we can utilize it when ES|QL supports this parameter. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Marco Vettorello <[email protected]> (cherry picked from commit df3665f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#205661) # Backport This will backport the following commits from `main` to `8.x`: - [[data.search] Clean up code around ES preference usage (#204076)](#204076) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Lukas Olson","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-06T22:02:48Z","message":"[data.search] Clean up code around ES preference usage (#204076)\n\n## Summary\r\n\r\nWhile refreshing my memory on how we are using the Elasticsearch\r\n`preference` parameter, I noticed we had a method `getEsPreference` that\r\nwas exported but not used. We then had an additional method\r\n`getPreference` that was being used to actually set the parameter. I\r\nconsolidated these into one place and moved the tests so that we can\r\nutilize it when ES|QL supports this parameter.\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: Marco Vettorello <[email protected]>","sha":"df3665fbf59295dfbd664dfc280658b5232498d9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Search","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor"],"title":"[data.search] Clean up code around ES preference usage","number":204076,"url":"https://github.com/elastic/kibana/pull/204076","mergeCommit":{"message":"[data.search] Clean up code around ES preference usage (#204076)\n\n## Summary\r\n\r\nWhile refreshing my memory on how we are using the Elasticsearch\r\n`preference` parameter, I noticed we had a method `getEsPreference` that\r\nwas exported but not used. We then had an additional method\r\n`getPreference` that was being used to actually set the parameter. I\r\nconsolidated these into one place and moved the tests so that we can\r\nutilize it when ES|QL supports this parameter.\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: Marco Vettorello <[email protected]>","sha":"df3665fbf59295dfbd664dfc280658b5232498d9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204076","number":204076,"mergeCommit":{"message":"[data.search] Clean up code around ES preference usage (#204076)\n\n## Summary\r\n\r\nWhile refreshing my memory on how we are using the Elasticsearch\r\n`preference` parameter, I noticed we had a method `getEsPreference` that\r\nwas exported but not used. We then had an additional method\r\n`getPreference` that was being used to actually set the parameter. I\r\nconsolidated these into one place and moved the tests so that we can\r\nutilize it when ES|QL supports this parameter.\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: Marco Vettorello <[email protected]>","sha":"df3665fbf59295dfbd664dfc280658b5232498d9"}}]}] BACKPORT--> Co-authored-by: Lukas Olson <[email protected]>
## Summary While refreshing my memory on how we are using the Elasticsearch `preference` parameter, I noticed we had a method `getEsPreference` that was exported but not used. We then had an additional method `getPreference` that was being used to actually set the parameter. I consolidated these into one place and moved the tests so that we can utilize it when ES|QL supports this parameter. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Marco Vettorello <[email protected]>
## Summary While refreshing my memory on how we are using the Elasticsearch `preference` parameter, I noticed we had a method `getEsPreference` that was exported but not used. We then had an additional method `getPreference` that was being used to actually set the parameter. I consolidated these into one place and moved the tests so that we can utilize it when ES|QL supports this parameter. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Marco Vettorello <[email protected]>
## Summary While refreshing my memory on how we are using the Elasticsearch `preference` parameter, I noticed we had a method `getEsPreference` that was exported but not used. We then had an additional method `getPreference` that was being used to actually set the parameter. I consolidated these into one place and moved the tests so that we can utilize it when ES|QL supports this parameter. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Marco Vettorello <[email protected]>
Summary
While refreshing my memory on how we are using the Elasticsearch
preference
parameter, I noticed we had a methodgetEsPreference
that was exported but not used. We then had an additional methodgetPreference
that was being used to actually set the parameter. I consolidated these into one place and moved the tests so that we can utilize it when ES|QL supports this parameter.Checklist