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] respect the sample size settings when not sorting #4084

Merged
merged 1 commit into from
Jun 3, 2015

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Jun 3, 2015

For some time now discover has been sending the sort parameter in a new format. It was previously being read by the segmented fetch mechanism, but when the format changed the segmented fetch code was not updated. This causes more than the the configured sample size to show up in the table when sorted by timestamp.

update: To reproduce simply open discover in a fresh state, update your time filter to span multiple indices and a search result that contains more than 500 hits, and then scroll to the bottom of the results list. The "this is only 500 results" warning will be missing, the "size" param for each request should be set to 500, and there should be 500*nIndices rows visible

To fix this, the I added SegmentedHandle#setSize(). This method sets the number of hits that the segemented fetch will try to collect. As hits come back from elasticsearch, they are subtracted from this count and the next request will have a size parameter equal to the desired size minus the hits of the previous response.

When sorting by anything other than time we must request the total size from each index and re-sort hits clientside. To enable this, either don't call SegmentedHandle#setSize() or pass false.

@rashidkpc
Copy link
Contributor

Can you create reproduction steps for the behavior in master that this corrects?

@rashidkpc rashidkpc assigned spalger and unassigned rashidkpc Jun 3, 2015
@spalger spalger assigned rashidkpc and unassigned spalger Jun 3, 2015
@rashidkpc
Copy link
Contributor

LGTM

@rashidkpc rashidkpc assigned lukasolson and unassigned rashidkpc Jun 3, 2015
@lukasolson
Copy link
Member

LGTM.

lukasolson added a commit that referenced this pull request Jun 3, 2015
[discover] respect the sample size settings when not sorting
@lukasolson lukasolson merged commit 029360a into elastic:master Jun 3, 2015
@spalger spalger deleted the fix/sampleSizeDiscover branch June 12, 2015 00:57
cchaos added a commit that referenced this pull request Oct 1, 2020
cchaos added a commit to cchaos/kibana that referenced this pull request Oct 1, 2020
cchaos added a commit that referenced this pull request Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants