Warning in the docs for negative histogram values

As requested in https://github.com/elastic/elasticsearch/issues/8082#issuecomment-127962374
This commit is contained in:
Sylvain Zimmer 2015-08-06 18:00:08 -04:00 committed by Clinton Gormley
parent db541d6fbe
commit c2f774ac57
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,11 @@ bucket_key = value - rem
From the rounding function above it can be seen that the intervals themselves **must** be integers.
WARNING: Currently, values are cast to integers before being bucketed, which
might cause negative floating-point values to fall into the wrong bucket. For
instance, `-4.5` with an interval of `2` would be cast to `-4`, and so would
end up in the `-4 <= val < -2` bucket instead of the `-6 <= val < -4` bucket.
The following snippet "buckets" the products based on their `price` by interval of `50`:
[source,js]