I want to execute this sql query in java api for get elastic search data -
 select mime_type,count(*),sum(original_size) 
 from explore_object_metadata 
 group by mime_type;
I am able to get the data from elastic search for the following sql query -
select mimetype,count(*) 
from table 
group by mimetype
By the code in following link - elastic search aggregation in java for all indexes in elastic search
How I get this.