Skip to content

Commit eed8d1a

Browse files
aeroastroDaveCTurner
authored andcommitted
[DOC] Fix mathematical representation on interval (range) (#27450)
1 parent 3eeccb7 commit eed8d1a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/reference/aggregations/bucket/histogram-aggregation.asciidoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ To make this more formal, here is the rounding function that is used:
1414
bucket_key = Math.floor((value - offset) / interval) * interval + offset
1515
--------------------------------------------------
1616

17-
The `interval` must be a positive decimal, while the `offset` must be a decimal in `[0, interval[`.
17+
The `interval` must be a positive decimal, while the `offset` must be a decimal in `[0, interval)`
18+
(a decimal greater than or equal to `0` and less than `interval`)
1819

1920
The following snippet "buckets" the products based on their `price` by interval of `50`:
2021

@@ -73,7 +74,7 @@ And the following may be the response:
7374

7475
==== Minimum document count
7576

76-
The response above show that no documents has a price that falls within the range of `[100 - 150)`. By default the
77+
The response above show that no documents has a price that falls within the range of `[100, 150)`. By default the
7778
response will fill gaps in the histogram with empty buckets. It is possible change that and request buckets with
7879
a higher minimum count thanks to the `min_doc_count` setting:
7980

@@ -185,10 +186,10 @@ the `order` setting. Supports the same `order` functionality as the <<search-agg
185186
==== Offset
186187

187188
By default the bucket keys start with 0 and then continue in even spaced steps of `interval`, e.g. if the interval is 10 the first buckets
188-
(assuming there is data inside them) will be [0 - 9], [10-19], [20-29]. The bucket boundaries can be shifted by using the `offset` option.
189+
(assuming there is data inside them) will be `[0, 10)`, `[10, 20)`, `[20, 30)`. The bucket boundaries can be shifted by using the `offset` option.
189190

190191
This can be best illustrated with an example. If there are 10 documents with values ranging from 5 to 14, using interval `10` will result in
191-
two buckets with 5 documents each. If an additional offset `5` is used, there will be only one single bucket [5-14] containing all the 10
192+
two buckets with 5 documents each. If an additional offset `5` is used, there will be only one single bucket `[5, 15)` containing all the 10
192193
documents.
193194

194195
==== Response Format

0 commit comments

Comments
 (0)