Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kertal opened this issue Apr 17, 2023 · 1 comment · Fixed by #163784
Closed

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

kertal opened this issue Apr 17, 2023 · 1 comment · Fixed by #163784
Assignees
Labels
enhancement New value added to drive a business result Feature:Discover Discover Application impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@kertal
Copy link
Member

kertal commented Apr 17, 2023

Discover currently loads a maximum of documents defined by discover:sampleSize in Advanced settings. There's no way to go beyond this number unless changing this setting. The data table used by Discover, EuiDataGrid, also doesn't provide ways to allow the incremental loading of data. There's no quick way to change this limitation, but what could be done is to use the UI that's currently telling users, that they have reached the limit, to provide a link allowing them to load more. So behind the scenes, we could use search_after of ES search (https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#search-after) to append more documents to the current search result. So basically it could look like this:

Before:

After:

Bildschirmfoto 2023-04-17 um 12 02 43

The drawback of this approach: All documents, in this case, would be kept in the Browsers Memory, with adding more and more documents, the browser / host system might become unresponsive.

@kertal kertal added Feature:Discover Discover Application enhancement New value added to drive a business result Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Apr 17, 2023
@elasticmachine
Copy link
Contributor

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

@kertal kertal changed the title [Discover] Allow to load document beyond the limit of discover:sampleSize [Discover] Allow to load documents beyond the limit of discover:sampleSize Apr 17, 2023
@kertal kertal added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort labels Apr 27, 2023
@kertal kertal added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Jun 28, 2023
jughosta added a commit that referenced this issue Aug 17, 2023
…63784)

> [!WARNING]
> Sorry, I had to recreate the PR
#157241
> Please submit your review again.

- Closes #155019

Per docs
https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html
<img width="851" alt="Screenshot 2023-05-10 at 10 25 20"
src="https://github.com/elastic/kibana/assets/1415710/b4b9fef4-7dd8-40ed-8244-343889fc4367">


## 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:
<img width="400" alt="Screenshot 2023-05-08 at 17 36 19"
src="https://github.com/elastic/kibana/assets/1415710/fd9f45c4-5dc2-4103-83b9-8810e3a6e0df">

After:
<img width="400" alt="Screenshot 2023-05-08 at 17 37 13"
src="https://github.com/elastic/kibana/assets/1415710/fe9090c0-2116-4f77-9a57-a96ae6b00365">

2. 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](https://github.com/elastic/kibana/assets/1415710/53af9809-75cb-4b8a-8e99-d8f6d76b4981)

If refresh interval is on, the button becomes disabled:
![Aug-07-2023
16-24-58](https://github.com/elastic/kibana/assets/1415710/85db6144-98eb-40b5-ac88-80ea728bcd6b)

Date nanos demo:
![Aug-07-2023
16-34-59](https://github.com/elastic/kibana/assets/1415710/dc9fe0b1-e419-4c76-9fc6-79907b134e58)


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Discover Discover Application impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
3 participants