Is there a way to convert this code using Painless? the index have a field named created, and the goal is to convert the value to a different timezone, currently it's in UTC.
"aggregations": {
"dayOfWeek": {
"terms": {
"script": {
"inline": "doc['created'].date.setZone(org.joda.time.DateTimeZone.forID(tz)); doc['created'].date.dayOfWeek",
"lang": "groovy",
"params": {
"tz": "Europe/London"
}
}
}
}
}