-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Warn or prevent users from sorting the terms aggregation by count in ascending order #87115
Comments
@markharwood This isn't the default sort order for the Terms aggregation in Lens- your screenshot shows that you took some previous steps to configure the sort order of this aggregation, and I would not consider a bug because of the extra steps needed to get into this state. I agree that we should discourage ascending order, but we already have an issue tracking intuitive sorting experience changes. Closing as a duplicate of that issue. |
@wylieconlon These are the steps to reproduce: LensCount3.mov |
@markharwood That's right, that workflow is being discussed in the issue I linked above. Order of operations matters when constructing the chart: if you had dropped the field onto the middle drop target you would have received the chart you wanted, but instead you dragged it onto a specific dimension. |
Regardless of sequencing, I'd say the bug is that when selecting "Count of records" as a sort order for terms the default should never be ascending for the reasons I outlined above. @colings86 may go further and suggest we never offer it as an option given his previous comments on removing elasticsearch support for this. |
@markharwood I've proposed something in the linked issue which solves the same problem. Feel free to open an issue asking us to remove the ascending option for sorting by metrics, which we don't have an issue for. |
OK - let's change this issue then to be about the lack of Kibana warnings when sort by ascending results from elasticsearch include the unbounded error warning: To give a concrete example how this could easily happen: Given time-based indices, terms are not distributed evenly across the indices. Today for example "Tanya Roberts" is mentioned widely in news articles because she was reported as dead but then it was revealed she was alive. A very popular topic in today's news index. However the 80s Bond girl is very rarely mentioned, if at all, in older indices. So when you do a "rarest terms" aggregation across multiple shards the index for today would not return Tanya Roberts in the list of rarest values because she is seen as far from rare. However, another older index might have one mention of her and return that as being rare. So the final merged results for Tanya are 1 - entirely missing the large count from today's index. In these cases we take special care to supply a The warning in the response going unreported is this one: The data/mapping to recreate this error is here. I use shard-routing to recreate the uneven spread of names typical of time-based indices:
When working with descending count sort orders the results are much less prone to inaccuracy and are more bounded error margins (most shards agree on Trump, Obama etc being the most popular) but ascending sort order inaccuracies can be wild. |
Pinging @elastic/kibana-app (Team:KibanaApp) |
Since this issue is no longer about the default sort order, but asking for a new feature, I will change the title and description of the issue to be more specific about what feature is being requested. |
Plan of action for the fix-it-week: Try to keep the user on descending metric sorting
|
Worth pointing out this issue title has been changed to focus on preventing a particularly inaccurate configuration before searches happen and my broader point about Kibana ignoring all forms of accuracy warnings in search results is not addressed. |
Good point @markharwood - I split out a separate issue for this (#94918). Makes a lot of sense to make the user aware |
This issue has been edited to reflect the discussion below.
Feature request
In addition to making the sorting experience more intuitive, Lens should discourage the use of "ascending count" as a sort order, because it leads to inaccurate results in distributed systems.
Open question
Is it important to keep the ascending sort order for any options?
What about sorting in ascending order by other metrics, like average or max?
Original description
Using Cloud 7.10 I found the defaults for Lens top terms to be the wrong sort order
Ascending order is a bad default because:
We nearly removed the support for using the
terms
aggregation with this sort order due to the inaccuracies.Consider making "descending" the default sort order.
The text was updated successfully, but these errors were encountered: