# Histogram Aggregations with Decimal Interval

**URL:** <https://discuss.elastic.co/t/histogram-aggregations-with-decimal-interval/128390>\
**Category:** Elasticsearch\
**Created:** [April 17, 2018, 3:08pm UTC](https://discuss.elastic.co/t/histogram-aggregations-with-decimal-interval/128390 "2018-04-17T15:08:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dm90](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dm90](https://discuss.elastic.co/u/dm90)\
**Post date:** [April 17, 2018, 3:08pm UTC](https://discuss.elastic.co/t/histogram-aggregations-with-decimal-interval/128390/1 "2018-04-17T15:08:51Z")

</div>

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
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![dm90](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dm90](https://discuss.elastic.co/u/dm90)\
**Post date:** [April 17, 2018, 3:39pm UTC](https://discuss.elastic.co/t/histogram-aggregations-with-decimal-interval/128390/2 "2018-04-17T15:39:00Z")

</div>

I believe I have a mapping issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 15, 2018, 3:39pm UTC](https://discuss.elastic.co/t/histogram-aggregations-with-decimal-interval/128390/3 "2018-05-15T15:39:00Z")

</div>

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