We have a percentiles_bucket pipeline aggregation but we currently don't have the reverse operation percentile_ranks_bucket which would be the pipeline aggregation equivalent to the percentile_ranks aggregation.
Hi,
I am aware this functionality is not implemented yet, but is there a way i can accomplish percentile_rank over a bucket aggregation ?
Not currently, you would need to do this calculation in your client application for now.
This would be a neat feature to add, +1
cc @elastic/es-search-aggs
@colings86, I would like to pick this issue but I am new to Elasticsearch. I would need some pointers and ramp up time to finish this task. If that is okay, I would go ahead and take a stab at this. Thanks!
Heya @vishleshpatel :) All yours if you want to work on it! You'll need to implement a few different classes, but most are just boilerplate with some tweaked names/parameters. I'd use the existing percentiles bucket agg as a template:
PercentileRanksBucketPipelineAggregationBuilder, similar to PercentilesBucketPipelineAggregationBuilder. Builder object for java users, and contains to/from xcontent parsing for the REST jsonPercentileRanksBucketPipelineAggregator, similar to PercentilesBucketPipelineAggregator. This contains the code that does the actual aggregating, e.g. taking in the bucket values and emitting the percentile ranks valuesInternalPercentileRanksBucket, similar to InternalPercentilesBucket. This is the "internal" result, e.g. the result generated by the aggregator.PercentileRankBucket, similar to PercentilesBucket. Interface defining the response, can probably just extend PercentileRanks. Note that the prior "Internal" response implements this interface. The Internal object is the non-public API used by Elasticsearch, while the PercentileRankBucket interface is the API consumed by java clientsSearchModuleThere are probably other things I'm forgetting that you'll find along the way, but that should get you started. Happy to help, the best way is to probably a WIP PR that we can iterate on if you run into issues that you have questions about.
@polyfractal awesome!! thanks for the pointers! I would get going with this and ask you questions as I get puzzles on d way. Also, will open a WIP PR as I get small sample code changes ready.
@colings86 @vishleshpatel is this task still being worked on? If not I would like to try it out
Most helpful comment
Heya @vishleshpatel :) All yours if you want to work on it! You'll need to implement a few different classes, but most are just boilerplate with some tweaked names/parameters. I'd use the existing percentiles bucket agg as a template:
PercentileRanksBucketPipelineAggregationBuilder, similar toPercentilesBucketPipelineAggregationBuilder. Builder object for java users, and contains to/from xcontent parsing for the REST jsonPercentileRanksBucketPipelineAggregator, similar toPercentilesBucketPipelineAggregator. This contains the code that does the actual aggregating, e.g. taking in the bucket values and emitting the percentile ranks valuesInternalPercentileRanksBucket, similar toInternalPercentilesBucket. This is the "internal" result, e.g. the result generated by the aggregator.PercentileRankBucket, similar toPercentilesBucket. Interface defining the response, can probably just extendPercentileRanks. Note that the prior "Internal" response implements this interface. The Internal object is the non-public API used by Elasticsearch, while the PercentileRankBucket interface is the API consumed by java clientsSearchModuleThere are probably other things I'm forgetting that you'll find along the way, but that should get you started. Happy to help, the best way is to probably a WIP PR that we can iterate on if you run into issues that you have questions about.