我可以通过
获得聚合Aggregations aggregations = elasticsearchTemplate.query(searchQuery, new ResultsExtractor<Aggregations>() {
@Override
public Aggregations extract(SearchResponse response) {
return response.getAggregations();
}
});
我可以使用
获取ListList<MyBean> list = elasticsearchTemplate.queryForList(searchQuery, MyBean.class);
但问题是如何通过单一查询获得List和Aggregations?