I have been trying to use date histogram aggregation in elasticsearch and it returns the date as epoch or in yy-mm-dd-mm-ss format. But what I want is to get document count
For ES5 using painless, this works:
"aggs": { "dayOfWeek": { "terms": { "script": { "inline": "doc['date_utc'].date.dayOfWeek", "lang": "painless" } } } }