Skip to content

[Discover] Improve performance of breakdown field search#229335

Merged
jughosta merged 7 commits intoelastic:mainfrom
jughosta:221362-performance-fix-for-breakdown
Jul 28, 2025
Merged

[Discover] Improve performance of breakdown field search#229335
jughosta merged 7 commits intoelastic:mainfrom
jughosta:221362-performance-fix-for-breakdown

Conversation

@jughosta
Copy link
Contributor

@jughosta jughosta commented Jul 24, 2025

Summary

This PR moves the filtering logic from EuiSelectable to Kibana side so we can optimize and debounce it for Breakdown dropdown on Discover page. And looks like this component is also used somewhere in dataset quality details area.

Before (ui freeze):
Screenshot 2025-07-25 at 14 24 55

After (debounced calculations):
Screenshot 2025-07-25 at 14 34 03

This fix prevents the "freezing" of the UI during the search. Next possible step would be to evaluate when to enable/disable fuzzy search.

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 24, 2025
@jughosta jughosta added release_note:fix v9.0.0 Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// backport:version Backport to applied version labels v8.18.0 v9.1.0 v8.19.0 labels Jul 24, 2025
@jughosta jughosta marked this pull request as ready for review July 25, 2025 14:46
@jughosta jughosta requested a review from a team as a code owner July 25, 2025 14:46
@elasticmachine
Copy link
Contributor

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

@jughosta jughosta requested a review from a team July 25, 2025 14:47
Comment on lines +191 to +193
act(() => {
button.click();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use userEvent for this actions?

Comment on lines +218 to +219
input.focus();
fireEvent.change(input, { target: { value: 'extee' } });
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, can we use userEvent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did not work with useEvent when I tried (because it thinks for some reason that it can't accept pointer events) so I went with fireEvent here.

);

const filteredOptions = useMemo(
function filterOptionsForSearchValue() {
Copy link
Contributor

Choose a reason for hiding this comment

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

q: why is this one not an anonymous function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having names for functions allows to see them when profiling.

Copy link
Contributor

@AlexGPlay AlexGPlay left a comment

Choose a reason for hiding this comment

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

🚀

@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
datasetQuality 418.5KB 418.9KB +340.0B
discover 1.1MB 1.1MB +340.0B
total +680.0B

History

cc @jughosta

@yngrdyn yngrdyn self-requested a review July 28, 2025 12:00
@yngrdyn
Copy link
Contributor

yngrdyn commented Jul 28, 2025

/oblt-deploy

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

Everything is working as expected in Data set quality

Screen.Recording.2025-07-28.at.15.26.43.mov
@jughosta jughosta merged commit 2ef6e95 into elastic:main Jul 28, 2025
14 checks passed
@jughosta jughosta deleted the 221362-performance-fix-for-breakdown branch July 28, 2025 13:29
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 28, 2025
)

- Closes elastic#221362

## Summary

This PR moves the filtering logic from `EuiSelectable` to Kibana side so
we can optimize and debounce it for Breakdown dropdown on Discover page.
And looks like this component is also used somewhere in dataset quality
details area.

Before (ui freeze):
<img width="1203" height="423" alt="Screenshot 2025-07-25 at 14 24 55"
src="https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5"
/>

After (debounced calculations):
<img width="1196" height="525" alt="Screenshot 2025-07-25 at 14 34 03"
src="https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb"
/>

This fix prevents the "freezing" of the UI during the search. Next
possible step would be to evaluate when to enable/disable fuzzy search.

### 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 2ef6e95)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 28, 2025
)

- Closes elastic#221362

## Summary

This PR moves the filtering logic from `EuiSelectable` to Kibana side so
we can optimize and debounce it for Breakdown dropdown on Discover page.
And looks like this component is also used somewhere in dataset quality
details area.

Before (ui freeze):
<img width="1203" height="423" alt="Screenshot 2025-07-25 at 14 24 55"
src="https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5"
/>

After (debounced calculations):
<img width="1196" height="525" alt="Screenshot 2025-07-25 at 14 34 03"
src="https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb"
/>

This fix prevents the "freezing" of the UI during the search. Next
possible step would be to evaluate when to enable/disable fuzzy search.

### 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 2ef6e95)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 28, 2025
)

- Closes elastic#221362

## Summary

This PR moves the filtering logic from `EuiSelectable` to Kibana side so
we can optimize and debounce it for Breakdown dropdown on Discover page.
And looks like this component is also used somewhere in dataset quality
details area.

Before (ui freeze):
<img width="1203" height="423" alt="Screenshot 2025-07-25 at 14 24 55"
src="https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5"
/>

After (debounced calculations):
<img width="1196" height="525" alt="Screenshot 2025-07-25 at 14 34 03"
src="https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb"
/>

This fix prevents the "freezing" of the UI during the search. Next
possible step would be to evaluate when to enable/disable fuzzy search.

### 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 2ef6e95)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 28, 2025
)

- Closes elastic#221362

## Summary

This PR moves the filtering logic from `EuiSelectable` to Kibana side so
we can optimize and debounce it for Breakdown dropdown on Discover page.
And looks like this component is also used somewhere in dataset quality
details area.

Before (ui freeze):
<img width="1203" height="423" alt="Screenshot 2025-07-25 at 14 24 55"
src="https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5"
/>

After (debounced calculations):
<img width="1196" height="525" alt="Screenshot 2025-07-25 at 14 34 03"
src="https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb"
/>

This fix prevents the "freezing" of the UI during the search. Next
possible step would be to evaluate when to enable/disable fuzzy search.

### 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 2ef6e95)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.19
9.0
9.1

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 28, 2025
…) (#229649)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Discover] Improve performance of breakdown field search
(#229335)](#229335)

<!--- 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-28T13:29:02Z","message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"[Discover]
Improve performance of breakdown field
search","number":229335,"url":"https://github.com/elastic/kibana/pull/229335","mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229335","number":229335,"mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 28, 2025
) (#229645)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Discover] Improve performance of breakdown field search
(#229335)](#229335)

<!--- 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-28T13:29:02Z","message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"[Discover]
Improve performance of breakdown field
search","number":229335,"url":"https://github.com/elastic/kibana/pull/229335","mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229335","number":229335,"mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 28, 2025
) (#229646)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Discover] Improve performance of breakdown field search
(#229335)](#229335)

<!--- 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-28T13:29:02Z","message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"[Discover]
Improve performance of breakdown field
search","number":229335,"url":"https://github.com/elastic/kibana/pull/229335","mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229335","number":229335,"mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 28, 2025
…) (#229647)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Discover] Improve performance of breakdown field search
(#229335)](#229335)

<!--- 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-28T13:29:02Z","message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"[Discover]
Improve performance of breakdown field
search","number":229335,"url":"https://github.com/elastic/kibana/pull/229335","mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229335","number":229335,"mergeCommit":{"message":"[Discover]
Improve performance of breakdown field search (#229335)\n\n- Closes
https://github.com/elastic/kibana/issues/221362\n\n## Summary\n\nThis PR
moves the filtering logic from `EuiSelectable` to Kibana side so\nwe can
optimize and debounce it for Breakdown dropdown on Discover page.\nAnd
looks like this component is also used somewhere in dataset
quality\ndetails area.\n\nBefore (ui freeze):\n<img width=\"1203\"
height=\"423\" alt=\"Screenshot 2025-07-25 at 14 24
55\"\nsrc=\"https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5\"\n/>\n\nAfter
(debounced calculations):\n<img width=\"1196\" height=\"525\"
alt=\"Screenshot 2025-07-25 at 14 34
03\"\nsrc=\"https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb\"\n/>\n\nThis
fix prevents the \"freezing\" of the UI during the search.
Next\npossible step would be to evaluate when to enable/disable fuzzy
search.\n\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":"2ef6e9550536259ff3278c201aebec01f9bd02a0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
)

- Closes elastic#221362

## Summary

This PR moves the filtering logic from `EuiSelectable` to Kibana side so
we can optimize and debounce it for Breakdown dropdown on Discover page.
And looks like this component is also used somewhere in dataset quality
details area.

Before (ui freeze):
<img width="1203" height="423" alt="Screenshot 2025-07-25 at 14 24 55"
src="https://github.com/user-attachments/assets/682d923d-3996-4bb2-9e3b-d3daa27197f5"
/>

After (debounced calculations):
<img width="1196" height="525" alt="Screenshot 2025-07-25 at 14 34 03"
src="https://github.com/user-attachments/assets/70987d23-934c-4aa7-90a5-e69759e10beb"
/>

This fix prevents the "freezing" of the UI during the search. Next
possible step would be to evaluate when to enable/disable fuzzy search.


### 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

backport:version Backport to applied version 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.18.5 v8.19.1 v9.0.5 v9.1.1 v9.2.0

6 participants