I want to apply non standard time interval aggregation (hourOfDay, dayOfWeek etc.) on my date field.
{
"size":0,
"aggregations":{
"groupby_timeinterval":{
"terms":{
"script":{
"source":"def value = doc.start_time.value; return value.hourOfDay",
"lang":"painless"
}
}
}
}
}
In ES 2.x, this above term aggregation used to allow "time_zone" parameter that helped us get result aggregates also considering time_zone but that support is no more from ES 5.x.
How can we apply timezone to the above query?
Painless documentation doesn't given out any clues. When I tried to improvise and apply functions on the "value" (of type org.joda.time.MutableDateTime) I am getting "Unable to find dynamic method" error.