[Discover] Update the logic of selecting a sub field to be used when fetching field stats#228969
Conversation
| if (field.aggregatable) { | ||
| return field; | ||
| } |
💚 Build Succeeded
Metrics [docs]Async chunks
cc @jughosta |
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
davismcphee
left a comment
There was a problem hiding this comment.
Code-only review, just acting as a second set of eyes. This change definitely makes sense to me, thanks for fixing it!
|
Starting backport for target branches: 8.17, 8.18, 8.19 |
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit 2e40596)
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit 2e40596)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit 2e40596)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit 2e40596) # Conflicts: # packages/kbn-unified-field-list/src/containers/unified_field_list_item/field_list_item_stats.test.ts
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit 2e40596)
…d when fetching field stats (#228969) (#229242) # Backport This will backport the following commits from `main` to `8.17`: - [[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)](#228969) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-07-24T05:56:58Z","message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-major","v9.2.0"],"title":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats","number":228969,"url":"https://github.com/elastic/kibana/pull/228969","mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228969","number":228969,"mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},{"url":"https://github.com/elastic/kibana/pull/229237","number":229237,"branch":"8.18","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/229238","number":229238,"branch":"8.19","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/229240","number":229240,"branch":"9.1","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/229241","number":229241,"branch":"9.0","state":"OPEN"}]}] BACKPORT-->
…d when fetching field stats (#228969) (#229238) # Backport This will backport the following commits from `main` to `8.19`: - [[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)](#228969) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-07-24T05:56:58Z","message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-major","v9.2.0"],"title":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats","number":228969,"url":"https://github.com/elastic/kibana/pull/228969","mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228969","number":228969,"mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
…d when fetching field stats (#228969) (#229237) # Backport This will backport the following commits from `main` to `8.18`: - [[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)](#228969) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-07-24T05:56:58Z","message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-major","v9.2.0"],"title":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats","number":228969,"url":"https://github.com/elastic/kibana/pull/228969","mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228969","number":228969,"mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
… when fetching field stats (#228969) (#229240) # Backport This will backport the following commits from `main` to `9.1`: - [[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)](#228969) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-07-24T05:56:58Z","message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-major","v9.2.0"],"title":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats","number":228969,"url":"https://github.com/elastic/kibana/pull/228969","mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228969","number":228969,"mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},{"url":"https://github.com/elastic/kibana/pull/229237","number":229237,"branch":"8.18","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/229238","number":229238,"branch":"8.19","state":"OPEN"}]}] BACKPORT-->
… when fetching field stats (#228969) (#229241) # Backport This will backport the following commits from `main` to `9.0`: - [[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)](#228969) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-07-24T05:56:58Z","message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-major","v9.2.0"],"title":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats","number":228969,"url":"https://github.com/elastic/kibana/pull/228969","mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228969","number":228969,"mergeCommit":{"message":"[Discover] Update the logic of selecting a sub field to be used when fetching field stats (#228969)\n\n- Fixes https://github.com/elastic/kibana/issues/228952\n\n## Summary\n\nThis PR fixes what field is being picked for fetching stats in the\nsidebar popover. Previously, it was choosing one of the multi fields,\nnow it will choose the parent field first (sidebar groups similar fields\nand displays them inside the popover).\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"2e40596a12abc3cd942eb09588895a7b5eafa0e6"}},{"url":"https://github.com/elastic/kibana/pull/229237","number":229237,"branch":"8.18","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/229238","number":229238,"branch":"8.19","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/229240","number":229240,"branch":"9.1","state":"OPEN"}]}] BACKPORT-->
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
…fetching field stats (elastic#228969) - Fixes elastic#228952 ## Summary This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover). ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
Summary
This PR fixes what field is being picked for fetching stats in the sidebar popover. Previously, it was choosing one of the multi fields, now it will choose the parent field first (sidebar groups similar fields and displays them inside the popover).
Checklist
release_note:*label is applied per the guidelinesbackport:*labels.