I'm using terms aggregations with script property, i know that i can use format property to get date value in specific date format; but i wanna write required format to be gotten inside script source code.
{
"size": 0,
"aggs": {
"NAME": {
"terms": {
"script": {
"source": "doc['Ship Date'].value",
"lang": "painless"
},
"size": 100,
"order": {
"_key": "asc"
}
}
}
}
}