Histogram Aggregations with Decimal Interval

Running Elasticsearch Version 6.2.2, I'm having trouble with the histogam aggregation

I have a field with decimal numbers, and I'm running an aggregation like this:

GET myindex/mytype/_search?
{
  "size": 0,
  "aggs":  {
    "my_hist": {
      "histogram": {
          "field": "decimal_field",
          "interval": 0.1,
          "min_doc_count": 0
      }
    }
  }
}

The aggregation succesfully returns with bin keys spaced 0.1 apart, however the documents only bin on round (integer) numbers. I've verified the documents do contain decimal values other than ".0" and that "decimal_field" is mapped as a number. I've also verified that all the documents are included in the aggregation.

It seems to me that the aggregation is behaving like this, where the interval is just "1" instead of "0.1":

GET myindex/mytype/_search?
{
  "size": 0,
  "aggs":  {
    "my_hist": {
      "histogram": {
          "field": "decimal_field",
          "interval": 1,
          "min_doc_count": 1
      }
    }
  }
}

I believe I have a mapping issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.