Skip to content

[Discover] Update the logic of selecting a sub field to be used when fetching field stats#228969

Merged
jughosta merged 1 commit intoelastic:mainfrom
jughosta:228952-update-field-stats-field
Jul 24, 2025
Merged

[Discover] Update the logic of selecting a sub field to be used when fetching field stats#228969
jughosta merged 1 commit intoelastic:mainfrom
jughosta:228952-update-field-stats-field

Conversation

@jughosta
Copy link
Contributor

@jughosta jughosta commented Jul 22, 2025

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

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.
@jughosta jughosta self-assigned this Jul 22, 2025
@jughosta jughosta added release_note:fix Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// backport:prev-major labels Jul 22, 2025
Comment on lines +82 to +84
if (field.aggregatable) {
return field;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The actual fix.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.1MB 1.1MB +36.0B
lens 1.5MB 1.5MB +34.0B
securitySolution 9.8MB 9.8MB +36.0B
slo 975.7KB 975.7KB +36.0B
total +142.0B

cc @jughosta

@jughosta jughosta marked this pull request as ready for review July 22, 2025 16:04
@jughosta jughosta requested a review from a team as a code owner July 22, 2025 16:04
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@jughosta jughosta changed the title [Discover] Update the logic of picking a sub field to be used when fetching field stats Jul 23, 2025
Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Code-only review, just acting as a second set of eyes. This change definitely makes sense to me, thanks for fixing it!

@jughosta jughosta merged commit 2e40596 into elastic:main Jul 24, 2025
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19

https://github.com/elastic/kibana/actions/runs/16488982773

@jughosta jughosta deleted the 228952-update-field-stats-field branch July 24, 2025 05:58
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 24, 2025
…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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 24, 2025
…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)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17 Backport failed because of merge conflicts
8.18
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 228969

Questions ?

Please refer to the Backport tool documentation

@jughosta
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@jughosta
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

jughosta added a commit to jughosta/kibana that referenced this pull request Jul 24, 2025
…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)
@jughosta
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

jughosta added a commit to jughosta/kibana that referenced this pull request Jul 24, 2025
…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
jughosta added a commit to jughosta/kibana that referenced this pull request Jul 24, 2025
…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)
jughosta added a commit that referenced this pull request Jul 24, 2025
…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-->
kibanamachine added a commit that referenced this pull request Jul 24, 2025
…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>
kibanamachine added a commit that referenced this pull request Jul 24, 2025
…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>
jughosta added a commit that referenced this pull request Jul 24, 2025
… 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-->
jughosta added a commit that referenced this pull request Jul 24, 2025
… 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-->
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…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.
@mistic mistic added v8.19.1 and removed v8.19.0 labels Jul 29, 2025
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Jul 31, 2025
…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.
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:fix Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v8.17.10 v8.18.5 v8.19.1 v9.0.5 v9.1.0 v9.2.0

6 participants