WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Percentile Ranks aggregation
editPercentile Ranks aggregation
editA multi-value metrics aggregation that calculates one or more percentile ranks over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script.
Fluent DSL
editvar result = client.Search<ElasticSearchProject>(s => s .Aggregations(a => a .PercentileRanks("commits_outlier", pr => pr .Field(p => p.NumberOfCommits) .Values(new[] { 15d, 30d }) .Script("doc['numberOfCommits'].value * 1.2") ) ) ); var percentilRanksAgg = r.Aggs.PercentilesRank("commits_outlier"); foreach (var item in percentilRanksAgg.Items) { // do something with item }
Object Initializer Syntax
editvar request = new SearchRequest { Aggregations = new Dictionary<string, IAggregationContainer> { { "commits_outlier", new AggregationContainer { PercentileRanks = new PercentileRanksAggregation { Field = "name", Values = new[] { 15d, 30d }, Script = "doc['numberOfCommits'].value * 1.2" } } } } };
Refer to the original docs for more information.