Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.16] [Discover] Show the fetched Discover results even when histogr…
…am request fails on some shards (#198553) (#199123) # Backport This will backport the following commits from `main` to `8.16`: - [[Discover] Show the fetched Discover results even when histogram request fails on some shards (#198553)](#198553) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T12:45:01Z","message":"[Discover] Show the fetched Discover results even when histogram request fails on some shards (#198553)\n\n- Closes https://github.com/elastic/kibana/issues/198496\r\n\r\n## Summary\r\n\r\nThis PR fixes an issue when the histogram request returns only a partial\r\nresult (0 or greater than 0) by adding a warning icon next to the total\r\nhits counter and not blocking the whole page with \"No results\" message\r\n(when partial result with 0 hits from histogram).\r\n\r\n<img width=\"1436\" alt=\"Screenshot 2024-10-31 at 15 45 17\"\r\nsrc=\"https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f\">\r\n\r\n### Testing\r\n\r\nExecute the following and open `example*` data view in Discover.\r\n\r\n```\r\nPUT example1\r\nPUT example1/_mapping\r\n{\r\n \"properties\": {\r\n \"message\": {\r\n \"type\": \"text\"\r\n },\r\n \"date\": {\r\n \"type\": \"date\"\r\n }\r\n }\r\n}\r\nPUT example1/_doc/11\r\n{\r\n \"message\": \"11\",\r\n \"date\": \"2024-11-11T12:10:30Z\"\r\n}\r\nPUT example1/_doc/12\r\n{\r\n \"message\": \"22\",\r\n \"date\": \"2024-11-12T12:10:30Z\"\r\n}\r\n\r\nPUT example2\r\nPUT example2/_mapping\r\n{\r\n \"properties\": {\r\n \"message\": {\r\n \"type\": \"keyword\"\r\n },\r\n \"date\": {\r\n \"type\": \"date\"\r\n }\r\n }\r\n}\r\nPUT example2/_doc/21\r\n{\r\n \"message\": \"21\",\r\n \"date\": \"2024-12-01T12:10:30Z\"\r\n}\r\nPUT example2/_doc/22\r\n{\r\n \"message\": \"22\",\r\n \"date\": \"2024-12-02T12:10:30Z\"\r\n}\r\n```\r\n\r\nThen add `message` as a breakdown field.\r\n\r\nNotice that the histogram gets some partial results:\r\n<img width=\"1563\" alt=\"Screenshot 2024-10-31 at 16 11 14\"\r\nsrc=\"https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2\">\r\n\r\nNow, add a filter for `_id: 11` and notice that the histogram request\r\nhas no results (it partially failed on some shards) but Discover still\r\nrenders the table:\r\n<img width=\"1564\" alt=\"Screenshot 2024-10-31 at 16 11 31\"\r\nsrc=\"https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb\">\r\n\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <[email protected]>","sha":"c1e00a887173e8b86fd58fa0e7e768e4f0b1643c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:DataDiscovery","v8.16.0","backport:version","v8.17.0"],"title":"[Discover] Show the fetched Discover results even when histogram request fails on some shards","number":198553,"url":"https://github.com/elastic/kibana/pull/198553","mergeCommit":{"message":"[Discover] Show the fetched Discover results even when histogram request fails on some shards (#198553)\n\n- Closes https://github.com/elastic/kibana/issues/198496\r\n\r\n## Summary\r\n\r\nThis PR fixes an issue when the histogram request returns only a partial\r\nresult (0 or greater than 0) by adding a warning icon next to the total\r\nhits counter and not blocking the whole page with \"No results\" message\r\n(when partial result with 0 hits from histogram).\r\n\r\n<img width=\"1436\" alt=\"Screenshot 2024-10-31 at 15 45 17\"\r\nsrc=\"https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f\">\r\n\r\n### Testing\r\n\r\nExecute the following and open `example*` data view in Discover.\r\n\r\n```\r\nPUT example1\r\nPUT example1/_mapping\r\n{\r\n \"properties\": {\r\n \"message\": {\r\n \"type\": \"text\"\r\n },\r\n \"date\": {\r\n \"type\": \"date\"\r\n }\r\n }\r\n}\r\nPUT example1/_doc/11\r\n{\r\n \"message\": \"11\",\r\n \"date\": \"2024-11-11T12:10:30Z\"\r\n}\r\nPUT example1/_doc/12\r\n{\r\n \"message\": \"22\",\r\n \"date\": \"2024-11-12T12:10:30Z\"\r\n}\r\n\r\nPUT example2\r\nPUT example2/_mapping\r\n{\r\n \"properties\": {\r\n \"message\": {\r\n \"type\": \"keyword\"\r\n },\r\n \"date\": {\r\n \"type\": \"date\"\r\n }\r\n }\r\n}\r\nPUT example2/_doc/21\r\n{\r\n \"message\": \"21\",\r\n \"date\": \"2024-12-01T12:10:30Z\"\r\n}\r\nPUT example2/_doc/22\r\n{\r\n \"message\": \"22\",\r\n \"date\": \"2024-12-02T12:10:30Z\"\r\n}\r\n```\r\n\r\nThen add `message` as a breakdown field.\r\n\r\nNotice that the histogram gets some partial results:\r\n<img width=\"1563\" alt=\"Screenshot 2024-10-31 at 16 11 14\"\r\nsrc=\"https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2\">\r\n\r\nNow, add a filter for `_id: 11` and notice that the histogram request\r\nhas no results (it partially failed on some shards) but Discover still\r\nrenders the table:\r\n<img width=\"1564\" alt=\"Screenshot 2024-10-31 at 16 11 31\"\r\nsrc=\"https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb\">\r\n\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <[email protected]>","sha":"c1e00a887173e8b86fd58fa0e7e768e4f0b1643c"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198553","number":198553,"mergeCommit":{"message":"[Discover] Show the fetched Discover results even when histogram request fails on some shards (#198553)\n\n- Closes https://github.com/elastic/kibana/issues/198496\r\n\r\n## Summary\r\n\r\nThis PR fixes an issue when the histogram request returns only a partial\r\nresult (0 or greater than 0) by adding a warning icon next to the total\r\nhits counter and not blocking the whole page with \"No results\" message\r\n(when partial result with 0 hits from histogram).\r\n\r\n<img width=\"1436\" alt=\"Screenshot 2024-10-31 at 15 45 17\"\r\nsrc=\"https://github.com/user-attachments/assets/9a769fe6-bdcf-4d20-ae6e-698a5b08d76f\">\r\n\r\n### Testing\r\n\r\nExecute the following and open `example*` data view in Discover.\r\n\r\n```\r\nPUT example1\r\nPUT example1/_mapping\r\n{\r\n \"properties\": {\r\n \"message\": {\r\n \"type\": \"text\"\r\n },\r\n \"date\": {\r\n \"type\": \"date\"\r\n }\r\n }\r\n}\r\nPUT example1/_doc/11\r\n{\r\n \"message\": \"11\",\r\n \"date\": \"2024-11-11T12:10:30Z\"\r\n}\r\nPUT example1/_doc/12\r\n{\r\n \"message\": \"22\",\r\n \"date\": \"2024-11-12T12:10:30Z\"\r\n}\r\n\r\nPUT example2\r\nPUT example2/_mapping\r\n{\r\n \"properties\": {\r\n \"message\": {\r\n \"type\": \"keyword\"\r\n },\r\n \"date\": {\r\n \"type\": \"date\"\r\n }\r\n }\r\n}\r\nPUT example2/_doc/21\r\n{\r\n \"message\": \"21\",\r\n \"date\": \"2024-12-01T12:10:30Z\"\r\n}\r\nPUT example2/_doc/22\r\n{\r\n \"message\": \"22\",\r\n \"date\": \"2024-12-02T12:10:30Z\"\r\n}\r\n```\r\n\r\nThen add `message` as a breakdown field.\r\n\r\nNotice that the histogram gets some partial results:\r\n<img width=\"1563\" alt=\"Screenshot 2024-10-31 at 16 11 14\"\r\nsrc=\"https://github.com/user-attachments/assets/8a53f661-38a2-48f8-b082-823de77ac4f2\">\r\n\r\nNow, add a filter for `_id: 11` and notice that the histogram request\r\nhas no results (it partially failed on some shards) but Discover still\r\nrenders the table:\r\n<img width=\"1564\" alt=\"Screenshot 2024-10-31 at 16 11 31\"\r\nsrc=\"https://github.com/user-attachments/assets/e154ab5d-c5d4-4703-abd4-7bf3cd7a15fb\">\r\n\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee <[email protected]>","sha":"c1e00a887173e8b86fd58fa0e7e768e4f0b1643c"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <[email protected]>
- Loading branch information