I want to get the aggregation result as day of week in text format like Monday, Tuesday etc. I have the following aggregation in which I am getting the result as day of week but in number format like 1 for monday, 2 for tuesday etc.
"aggs": {
"perWeekDay": {
"terms": {
"script": "doc['order_datetime'].date.dayOfWeek"
}
}
}
Update: I am doing this using script because I want to add custom field in kibana where I need to mention this script.