Aggregation date using RestHighLevelClient

I'm trying to implement sql below:
select format(date,'yyyy-MM-dd'), count(*) group by format(date,'yyyy-MM-dd')
using RestHighLevelClient
java code:

    SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
    SearchRequest searchRequest = new SearchRequest("order_*");
    SearchResponse searchResponse =, RequestOptions.DEFAULT);
    Aggregations aggregations = searchResponse.getAggregations();

I got the result but with many repeat date results as images shows below:

How should I avoid repeat date? I mean the same date(such as 2020-03-05) count as one row.

I've found my answer:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.