ElasticSearch中使用“group by“ 统计 (ElasticsearchTemplate进行聚合查询)
我用的es是6.8.1如果我们想在es实现sql中的groupby的查询统计效果SELECTCOUNT(id)FROMpatientstudyGROUPBYhospitalId;在kibana中执行命令POST/patientstudy/_search?size=0{"aggs":{"count":{"terms":{"field":"hospitalId"}}}}看结果用java怎么实现呢pub