# Date histogram aggregation issue for arrays fields

**URL:** <https://discuss.elastic.co/t/date-histogram-aggregation-issue-for-arrays-fields/294965>\
**Category:** Elasticsearch\
**Created:** [January 20, 2022, 3:28pm UTC](https://discuss.elastic.co/t/date-histogram-aggregation-issue-for-arrays-fields/294965 "2022-01-20T15:28:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marek\_Siwiec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marek_siwiec/32/45680_2.png) [@Marek\_Siwiec](https://discuss.elastic.co/u/Marek_Siwiec)\
**Post date:** [January 20, 2022, 3:28pm UTC](https://discuss.elastic.co/t/date-histogram-aggregation-issue-for-arrays-fields/294965/1 "2022-01-20T15:28:27Z")

</div>

Hello!  
I trying to update ES from 7.10.2 to 7.16.3 and I encounter an issue with Date histogram aggregation. When I have a document with a date field as an array with date aggregation by month on that field, then I expect that buckets will be produced for each month. This is true until I select some bucket. In that situation, I gotted only the selected facet as a result. Rest are gone.  
If I select with date range it started working, but this isn't a convenient way for me to handle that situation. Also, it's working on 7.10.2.

Example below:

```auto
//create doc 
POST test/_doc
{
  "date":["2021-05-01","2021-04-01","2021-04-22"]
}
//make a search request with filter (doesn't work in 7.16.3, but works in 7.10.2)
GET test/_search?q=date:2021-04-01
{
  "aggs": {
    "NAME": {
      "date_histogram": {
        "field": "date",
        "interval": "1M"
      }
    }
  }
}

//make a search request with filter (work)
GET test/_search?q=date:[2021-04-01 TO 2021-08-01]
{
  "aggs": {
    "NAME": {
      "date_histogram": {
        "field": "date",
        "interval": "1M"
      }
    }
  }
}

```

It's an intended change or a bug? Am I missing something? Please help 🙂

---

<div class="post-metadata">

**Author:** ![Marek\_Siwiec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marek_siwiec/32/45680_2.png) [@Marek\_Siwiec](https://discuss.elastic.co/u/Marek_Siwiec)\
**Post date:** [January 29, 2022, 5:13pm UTC](https://discuss.elastic.co/t/date-histogram-aggregation-issue-for-arrays-fields/294965/2 "2022-01-29T17:13:57Z")

</div>

It's defined as a bug from 7.11.0, related issue: [Data histogram aggregation issue for arrays field · Issue #82903 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/82903)

---

<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:** [February 26, 2022, 5:14pm UTC](https://discuss.elastic.co/t/date-histogram-aggregation-issue-for-arrays-fields/294965/3 "2022-02-26T17:14:11Z")

</div>

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