瀏覽代碼

Warning in the docs for negative histogram values

As requested in https://github.com/elastic/elasticsearch/issues/8082#issuecomment-127962374
Sylvain Zimmer 10 年之前
父節點
當前提交
c2f774ac57
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      docs/reference/aggregations/bucket/histogram-aggregation.asciidoc

+ 5 - 0
docs/reference/aggregations/bucket/histogram-aggregation.asciidoc

@@ -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]