Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Percentiles Aggregation

More info about percentiles aggregation is in the official elasticsearch docs

A multi-value metrics aggregation that calculates one or more percentiles over numeric values extracted from the aggregated documents.

Simple example

{
    "aggregations" : {
        "agg_load_time_outlier" : {
            "percentiles" : {
                "field" : "load_time"
            }
        }
    }
}

And now the query via DSL:

$percentilesAggregation = new PercentilesAggregation('load_time_outlier', 'load_time');

$search = new Search();
$search->addAggregation($percentilesAggregation);

$queryArray = $search->toArray();