Fixed interval in date histogram error

Elasticsearch Version

7.17.4

Java Version

1.8.0

OS Version

Linux

Problem Description

I use date_histogram aggregation from Elasticsearch with fixed_interval of 7d in time range from 2022-06-18 to 2022-07-01(14days). my expected result is two buckets with two 7days interval start from 06-18. but actually i got 3 buckets, and first from 06-16 even not in my range query.
sorry if this is not a bug, and what can i do to get right result.

Steps to Reproduce

{
"query": {
"range": {
"date": {
"from": "2022-06-18",
"to": "2022-07-01"
}
}
},
"size": 0,
"aggs": {
"data_analysis": {
"date_histogram": {
"field": "date",
"fixed_interval": "7d",
"min_doc_count": 1
}
}
}
}

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