-
Notifications
You must be signed in to change notification settings - Fork 840
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
Preserve elasticsearch order #1674
Conversation
Is the underlying issue here that unsorting the table does not return it to the original data order? |
@chandlerprall The underlaying issue is that searching a sorted table does not show the correct order returned by ES. This is all relevant only for InMemoryTable of course. |
if (!shouldClear) { | ||
// don't change sorting | ||
return {}; | ||
} else if (isQueryEmpty && sorting) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorting
is an object and will always be truthy here
Brought up this PR for discussion in slack with @elastic/kibana-design. We've concluded that not clearing the table's sort when the query changes more often matches a user's expectations and follows similar table implementations. |
Summary
Now that we've added the ability to unsort a talbe, we need to be able to use InMemoryTable to show search results in the order defined by ElasticSearch.
To achieve that, I added the preserveSearchResultOrder flag, which in conjunction with allowNeutralSort, will clear existing sorting upon search.
If initial sorting is provided, it's restored when the query is cleared.
Checklist
[ ] Jest tests were updated or added to match the most common scenarios~~ [ ] This required updates to Framer X components~~