Skip to content

Commit 0e001f3

Browse files
committed
DOCS: Correct explanation of percentiles_bucket (elastic#116499)
Corrects the explanation of `percentiles_bucket` so it's clear that it returns the `nth` largest item always, and it rounds `n` towards infinity. That's how it's worked since 2016 but the docs talked about "not greater than" which I don't think is particularly clear.
1 parent 1a6e1ba commit 0e001f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ And the following may be the response:
127127

128128
==== Percentiles_bucket implementation
129129

130-
The Percentile Bucket returns the nearest input data point that is not greater than the requested percentile; it does not
131-
interpolate between data points.
132-
133130
The percentiles are calculated exactly and is not an approximation (unlike the Percentiles Metric). This means
134131
the implementation maintains an in-memory, sorted list of your data to compute the percentiles, before discarding the
135132
data. You may run into memory pressure issues if you attempt to calculate percentiles over many millions of
136133
data-points in a single `percentiles_bucket`.
134+
135+
The Percentile Bucket returns the nearest input data point to the requested percentile, rounding indices toward
136+
positive infinity; it does not interpolate between data points. For example, if there are eight data points and
137+
you request the `50%th` percentile, it will return the `4th` item because `ROUND_UP(.50 * (8-1))` is `4`.

0 commit comments

Comments
 (0)