Elasticsearch: Create a percentile_ranks_bucket pipeline aggregation

Created on 22 Jul 2016  路  8Comments  路  Source: elastic/elasticsearch

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.

:AnalyticAggregations >feature Analytics good first issue help wanted

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 to PercentilesBucketPipelineAggregationBuilder. Builder object for java users, and contains to/from xcontent parsing for the REST json
  • PercentileRanksBucketPipelineAggregator, similar to PercentilesBucketPipelineAggregator. This contains the code that does the actual aggregating, e.g. taking in the bucket values and emitting the percentile ranks values
  • InternalPercentileRanksBucket, 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 clients
  • Register the new aggregation in the SearchModule

There 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.

All 8 comments

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 json
  • PercentileRanksBucketPipelineAggregator, similar to PercentilesBucketPipelineAggregator. This contains the code that does the actual aggregating, e.g. taking in the bucket values and emitting the percentile ranks values
  • InternalPercentileRanksBucket, 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 clients
  • Register the new aggregation in the SearchModule

There 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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rjernst picture rjernst  路  3Comments

brwe picture brwe  路  3Comments

malpani picture malpani  路  3Comments

ttaranov picture ttaranov  路  3Comments

abrahamduran picture abrahamduran  路  3Comments