请教大神 kibana 如何实现按星期分组聚合

请教大神 实现显示星期一、星期二......星期日,所有在星期一的记录数加到一起,星期二也一样

最终实现 上图效果

"aggs": {
   "perWeekDay": {
       "terms": {
           "script": "(doc['order_datetime'].date.dayOfWeek == 1 ? 'Monday' : (doc['order_datetime'].date.dayOfWeek == 2 ? 'Tuesday' : ((doc['order_datetime'].date.dayOfWeek == 3 ? 'Wednesday' : ((doc['order_datetime'].date.dayOfWeek == 4 ? 'Thursday' : ((doc['order_datetime'].date.dayOfWeek == 5 ? 'Friday' : ((doc['order_datetime'].date.dayOfWeek == 6 ? 'Saturday' : 'Sunday'))))))))))"
       }
    }
}