I have an index with 3 fields: user_id, count, timestamp.
I would like to be able to aggregate count by user_id, which is easy with elastic search, however, what I also want to be able to do is a percentile rank on this resulting data.
Is this possible?
Yes, it may be achieved using Pipelined Percentiles Bucket Aggregation which is a sibling pipeline aggregation which calculates percentiles across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation.
A percentiles_bucket aggregation looks like this in isolation:
The following snippet calculates the sum of all the total monthly sales buckets:
And the following may be the response: