Date histogram aggregation issue for arrays fields

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:

//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 :slight_smile:

It's defined as a bug from 7.11.0, related issue: Data histogram aggregation issue for arrays field · Issue #82903 · elastic/elasticsearch · GitHub

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