Minus timezone on date histogram aggregation shifts back buckets one day

this is my body request when search in elasticsearch version 1.5

{
    "body": {
        "size": 0,
        "query": {
            "filtered": {
                "filter": {
                    "bool": {
                        "must": [
                            {
                                "range": {
                                    "create_time": {
                                        "gte": "2020-09-02T00:00:00",
                                        "lte": "2020-09-05T23:59:59",
                                        "time_zone": "-2:00"
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        },
        "aggs": {
            "posts_over_time": {
                "date_histogram": {
                    "field": "create_time",
                    "interval": "day",
                    "min_doc_count": 0,
                    "time_zone": "-2:00",
                    "format": "yyyy-MM-dd",
                    "extended_bounds": {
                        "min": "2020-09-02",
                        "max": "2020-09-05"
                    }
                },
                "aggs": {
                    "Sum of engagements": {
                        "sum": {
                            "field": "interactions_count"
                        }
                    }
                }
            }
        }
    }
}

and result is shifted back one day return buckets from day 2020-09-01 to day 2020-09-04 not from day 2020-09-02 to day 2020-09-05 as expected

how to make result respect range without shifting and return result by the timezone of query ?

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