Skip to content

[OnWeek][Discover] Allow to fetch more documents on Discover page#163784

Merged
jughosta merged 70 commits intoelastic:mainfrom
jughosta:onweek-date-nanos-pagination-continues
Aug 17, 2023
Merged

[OnWeek][Discover] Allow to fetch more documents on Discover page#163784
jughosta merged 70 commits intoelastic:mainfrom
jughosta:onweek-date-nanos-pagination-continues

Conversation

@jughosta
Copy link
Contributor

@jughosta jughosta commented Aug 14, 2023

Warning

Sorry, I had to recreate the PR #157241
Please submit your review again.

Per docs https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html
Screenshot 2023-05-10 at 10 25 20

Summary

  1. This PR improves search_after pagination for date_nanos time fields. sort value will be returned from ES as a string instead of a rounded and incorrect timestamp. This change allows to also simplify logic on Surrounding document page.

Before:
Screenshot 2023-05-08 at 17 36 19

After:
Screenshot 2023-05-08 at 17 37 13

  1. Also in this PR we now allow users to load more documents within the same time range. Once the button is pressed, it will load next portion of documents (same "sampleSize" value will be used). Currently, we limit max total loaded documents to 10000.

"Load more" demo:
Aug-07-2023 16-23-28

If refresh interval is on, the button becomes disabled:
Aug-07-2023 16-24-58

Date nanos demo:
Aug-07-2023 16-34-59

100x Flaky test runner https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2801

jughosta and others added 30 commits May 9, 2023 13:05
…agination

# Conflicts:
#	src/plugins/discover/public/application/context/hooks/use_context_app_fetch.tsx
#	src/plugins/discover/public/application/context/services/context.ts
#	src/plugins/discover/public/application/main/components/layout/discover_documents.tsx
#	src/plugins/discover/public/application/main/services/discover_data_state_container.ts
#	src/plugins/discover/public/components/discover_grid/discover_grid.tsx
…agination

# Conflicts:
#	src/plugins/discover/public/application/context/hooks/use_context_app_fetch.tsx
#	src/plugins/discover/public/application/main/utils/update_search_source.ts
#	src/plugins/discover/public/utils/get_sharing_data.ts
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.

Pulled and tested one last time and confirmed the search sessions issue is all fixed! Thanks for all the work on this, it really is a long overdue feature and I think many users will appreciate it. Great work and LGTM 👍

@kibana-ci
Copy link

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #11 / Synthetics API Tests EnableDefaultAlerting returns the created alerted when called

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 627 629 +2

Async chunks

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

id before after diff
discover 557.4KB 562.7KB +5.3KB
Unknown metric groups

References to deprecated APIs

id before after diff
discover 20 19 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jughosta

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

LGTM, nice improvements!

@jughosta jughosta merged commit 110449d into elastic:main Aug 17, 2023
@jughosta jughosta deleted the onweek-date-nanos-pagination-continues branch August 17, 2023 18:31
@lukasolson lukasolson mentioned this pull request Mar 14, 2025
2 tasks
lukasolson added a commit that referenced this pull request Mar 18, 2025
## Summary

Resolves #213629.

Since #163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 18, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
(cherry picked from commit 2de4b33)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 18, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
(cherry picked from commit 2de4b33)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 18, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
(cherry picked from commit 2de4b33)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 18, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
(cherry picked from commit 2de4b33)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 18, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
(cherry picked from commit 2de4b33)
kibanamachine added a commit that referenced this pull request Mar 18, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [Fix sort for rollup data views
(#214656)](#214656)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lukas
Olson","email":"lukas@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T17:17:53Z","message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Search","release_note:fix","Feature:Data
Views","Feature:Rollups","Team:DataDiscovery","backport:all-open","v9.1.0"],"title":"Fix
sort for rollup data
views","number":214656,"url":"https://github.com/elastic/kibana/pull/214656","mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214656","number":214656,"mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}}]}]
BACKPORT-->

Co-authored-by: Lukas Olson <lukas@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 18, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [Fix sort for rollup data views
(#214656)](#214656)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lukas
Olson","email":"lukas@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T17:17:53Z","message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Search","release_note:fix","Feature:Data
Views","Feature:Rollups","Team:DataDiscovery","backport:all-open","v9.1.0"],"title":"Fix
sort for rollup data
views","number":214656,"url":"https://github.com/elastic/kibana/pull/214656","mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214656","number":214656,"mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}}]}]
BACKPORT-->

Co-authored-by: Lukas Olson <lukas@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 18, 2025
# Backport

This will backport the following commits from `main` to `8.16`:
- [Fix sort for rollup data views
(#214656)](#214656)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lukas
Olson","email":"lukas@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T17:17:53Z","message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Search","release_note:fix","Feature:Data
Views","Feature:Rollups","Team:DataDiscovery","backport:all-open","v9.1.0"],"title":"Fix
sort for rollup data
views","number":214656,"url":"https://github.com/elastic/kibana/pull/214656","mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214656","number":214656,"mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}}]}]
BACKPORT-->

Co-authored-by: Lukas Olson <lukas@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 18, 2025
# Backport

This will backport the following commits from `main` to `8.17`:
- [Fix sort for rollup data views
(#214656)](#214656)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lukas
Olson","email":"lukas@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T17:17:53Z","message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Search","release_note:fix","Feature:Data
Views","Feature:Rollups","Team:DataDiscovery","backport:all-open","v9.1.0"],"title":"Fix
sort for rollup data
views","number":214656,"url":"https://github.com/elastic/kibana/pull/214656","mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214656","number":214656,"mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}}]}]
BACKPORT-->

Co-authored-by: Lukas Olson <lukas@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 20, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [Fix sort for rollup data views
(#214656)](#214656)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lukas
Olson","email":"lukas@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T17:17:53Z","message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Search","release_note:fix","Feature:Data
Views","Feature:Rollups","Team:DataDiscovery","backport:all-open","v9.1.0"],"title":"Fix
sort for rollup data
views","number":214656,"url":"https://github.com/elastic/kibana/pull/214656","mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214656","number":214656,"mergeCommit":{"message":"Fix
sort for rollup data views (#214656)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/213629.\n\nSince
#163784 we have included
a\n`format` parameter in the `sort` that we send to Elasticsearch.
This\nworked for everything except rollup data views, which break when
the\n`format` parameter is provided.\n\nThis restores the behavior prior
to that PR (we still send the `sort`\nbut don't include the `format`
parameter). Ideally we would probably not\nsend the timestamp field at
all for rollup data views since we treat\nthem as if they are
non-time-based, but this would require a bit of a\nrefactor, and rollups
are deprecated anyway.\n\n### Checklist\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- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n\n### Release notes\n\nFixes opening a
rollup data view in Discover.\n\nCo-authored-by: Matthew Kime
<matt@mattki.me>","sha":"2de4b331d334454c4b3bb17b75dcdb83207ee9f9"}}]}]
BACKPORT-->

Co-authored-by: Lukas Olson <lukas@elastic.co>
clintandrewhall pushed a commit to clintandrewhall/kibana that referenced this pull request Mar 20, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Mar 31, 2025
## Summary

Resolves elastic#213629.

Since elastic#163784 we have included a
`format` parameter in the `sort` that we send to Elasticsearch. This
worked for everything except rollup data views, which break when the
`format` parameter is provided.

This restores the behavior prior to that PR (we still send the `sort`
but don't include the `format` parameter). Ideally we would probably not
send the timestamp field at all for rollup data views since we treat
them as if they are non-time-based, but this would require a bit of a
refactor, and rollups are deprecated anyway.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Release notes

Fixes opening a rollup data view in Discover.

Co-authored-by: Matthew Kime <matt@mattki.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Discover Discover Application release_note:enhancement Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v8.11.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Discover] Allow to load documents beyond the limit of discover:sampleSize

9 participants