-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Fix tiebreaker sort order in context view #32225
[Discover] Fix tiebreaker sort order in context view #32225
Conversation
Pinging @elastic/kibana-app |
💚 Build Succeeded |
💚 Build Succeeded |
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.
LGTM. I ddin't pull down and test, but reviewed, and also watched a demo of it. The main concern is whether or not the new sort order is problematic in some edge-case (such as alphabetic sorting). But ultimately, this is probably a reasonable short-put, and we need a longer-term plan to allow users to do multi-column sorts in an ad-hoc way.
I don't see how this would cause any additional edge cases, since it just changes the sort direction. Whether or not the direction is made configurable sounds like an independent consideration. |
@chrisdavies Think I need to do any backporting? |
@wylieconlon Why is this problem still exist in kibana7.1.1? |
@wylieconlon Could you perhaps still backport this to 7.x, it seems you unfortunately didn't get any answer that time. |
I thought this was already merged to 7.0.0 but it looks like I missed the branch-off date by a day. There are some conflicts in the backporting so I will need to take a closer look at the recent changes by @kertal |
@wylieconlon happy to help if you have any questions, there's also this unmarked PR taking care of the tiebreaker field in discover #32426. However in the meantime, there have been changes in terms of sorting (multi sorting is available) #42551 |
do not have enough time today to investigate, but I think tiebreaker in context was implemented also in 7.x what I did back in the days is merge 2 similar functions to |
since I did the changes in master, and merged it back, I think we're good here |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
5 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
should be safe to close it, but I will check to be sure |
Summary
The sort order for context view with tiebreakers was wrong, as reported in #12937 and #18647. For example, with the
context:tieBreakerFields
set tooffset,_doc
as described in those issues, you would get a context view with time ordering in reverse, as seen in these screenshots.The approach taken in this PR is to use the same sort order as the time field for tiebreakers, which is correct for numeric and date fields. I'm not aware of any cases where this order is wrong, but it if reviewers are able to think of situations where this approach is not generic enough, we can add a setting to Advanced Settings to choose the sort order.
Before:
After:
Closes #12937 and #18647.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers