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
Percentiles aggregations are always keyed and suggestion on non keyed response #5870
Comments
@Mpdreamz |
I realise its not a bucketing agg :) The code path for the percentiles agg always hits the if (keyed)` code path. Making the else routine dead code. The else routine introduces an array at a position all the other aggregations introduce an object which would make parsing the aggregations generically much much harder. i.e If we can remove the dead code and thus the chance to introduce an array at that position that would be great too. |
@Mpdreamz Not sure I'm following you tbh... maybe I'm missing something... if you send |
Ok my bad since keyed usually defaults to false (i.e range aggregation).
More specifically:
For
All other aggregations follow the pattern
The way nonkeyed percentiles are implemented right now feels like this:
And (as far as I could tell) non keyed percentiles are the only ones breaking the pattern here. |
yeah.. agree, I think |
We decided to change the response structure and instead of nesting all the percentiles directly under the aggregation name, nest it under an intermediate This is a breaking change but we feel it's important to make it while percentiles are still considered experimental. The new format is more future proof as it'll allow us to potentially add additional info under the aggregation in a later phase if there'll be a need for it. The new format is also somewhat more consistent with the other metrics aggs. |
…ow all the percentiles are placed under a `values` object (or `values` array in case the `keyed` flag is set to `false` Closes #5870
I realize the percentiles aggregations is still experimental which is probably the cause for this:
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/PercentilesParser.java#L60
The routine that is currently in place to write the percentiles
non_keyed
output will write the aggregation like this:https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/search/aggregations/metrics/percentiles/InternalPercentiles.java#L131
Making it the only aggregation to directly return an array instead of within a wrapped object.
Which makes the response very similar the non keyed range aggregation response:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html#search-aggregations-bucket-range-aggregation
The text was updated successfully, but these errors were encountered: