From 2c56ddbb484c0555417cf61399f3f7da005df0ea Mon Sep 17 00:00:00 2001 From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io> Date: Fri, 10 Jul 2015 12:06:20 +0300 Subject: [PATCH] Add Percentile Ranks aggregation doc. --- docs/Aggregation/PercentileRanks.md | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/Aggregation/PercentileRanks.md diff --git a/docs/Aggregation/PercentileRanks.md b/docs/Aggregation/PercentileRanks.md new file mode 100644 index 0000000..52f3826 --- /dev/null +++ b/docs/Aggregation/PercentileRanks.md @@ -0,0 +1,34 @@ +# Percentile Ranks Aggregation + +> More info about percentile ranks aggregation is in the [official elasticsearch docs][1] + +A multi-value metrics aggregation that calculates one or more percentile +ranks over numeric values extracted from the aggregated documents. + +## Simple example + +```JSON +{ + "aggregations" : { + "agg_load_time_outlier" : { + "percentile_ranks" : { + "field" : "load_time", + "values" : [15, 30] + } + } + } +} +``` + +And now the query via DSL: + +```php +$percentileRanksAggregation = new PercentileRanksAggregation('load_time_outlier', 'load_time', [15, 30]); + +$search = new Search(); +$search->addAggregation($percentileRanksAggregation); + +$queryArray = $search->toArray(); +``` + +[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-rank-aggregation.html -- GitLab