I have a document with field
"creationDate": "2015-12-13T22:00:00.000+0300"
the mapping for this field is:
"creationDate": {
"type": "date",
"format": "dateOptionalTime"
}
I want to create histogram aggregation and format output date in exist format with this query:
{
"size": 0,
"aggs": {
"docs": {
"filter": {
"and": {
"filters": [
{
"range": {
"creationDate": {
"gte": "2015-12-23T00:00:00+02:00",
"lte": "2015-12-23T23:59:59+02:00"
}
}
}
]
}
},
"aggs": {
"deep": {
"nested": {
"path": "actions"
},
"aggs": {
"histogram": {
"date_histogram": {
"field": "actions.creationDate",
"interval": "1h",
"format": "yyyy-MM-dd'T'HH:mm:ssZ",
"time_zone": "+03:00"
}
}
}
}
}
}
}
}
But as result I get result in UTC format:
{
"key_as_string": "2015-12-13T19:00:00+0000",
"key": 1450033200000,
"doc_count": 1
}
I don't understand why exist format transform to UTC and how can I get expected format? I thought that "time_zone" parameter should fix this issue but no