private final ElasticsearchRestTemplate elasticsearchTemplate;
NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withIndices(SalesBehaviorRecord.class.getAnnotation(Document.class).indexName()) .withQuery(query)
.addAggregation(aggregationBuilder)
.withPageable(Pageable.unpaged())
.build();
Aggregations aggregations = elasticsearchTemplate.query(searchQuery, SearchResponse::getAggregations);
聚合查询后不想返回查询的数据,这个改怎么写,不分页这样效果吗。或者 PageRequet.of(0,1) 这是返回一条数据
NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withIndices(SalesBehaviorRecord.class.getAnnotation(Document.class).indexName()) .withQuery(query)
.addAggregation(aggregationBuilder)
.withPageable(Pageable.unpaged())
.build();
Aggregations aggregations = elasticsearchTemplate.query(searchQuery, SearchResponse::getAggregations);
聚合查询后不想返回查询的数据,这个改怎么写,不分页这样效果吗。或者 PageRequet.of(0,1) 这是返回一条数据
1 个回复
Pengfei
赞同来自:
return-only-agg-results