-
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
Allow sorting by median #79839
Allow sorting by median #79839
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
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.
Tested and LGTM!
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
I think the implementation here makes sense, but would be great if we could add a few unit tests, perhaps on terms agg and/or median agg type.
Tested Chrome (macOS), looks good!
💚 Build SucceededMetrics [docs]page load bundle size
History
To update your PR or re-run it, just comment with: |
Fixes #79836
This PR makes it possible to sort by median by prefixing the bucket path in the terms agg with
.50
. This is necessary because median uses percentiles under the hood which is a multi metric, so it's necessary to point to the specific value within the multi metric.To handle this, I introduced a new property
getValueBucketPath
on the agg config which is passed in from the agg type. The default implementation just takes the id, for the median type it's implemented by adding the.50
suffix.