Reputation: 389
We are using Spring Data Elasticsearch Reactive Template
Query searchQuery = new NativeSearchQueryBuilder()
.withQuery(queryBuilder)
.withPageable(PageRequest.of(0, 10))
.addAggregation(AggregationBuilders.terms("categories").field("category"))
.build();
reactiveElasticsearchTemplate.search(searchQuery, documentType, IndexCoordinates.of(indexName))
In response we have Flux<SearchHit<T>>
but there are no methods to retrieve aggregations.
How to retrieve the aggregations?
Upvotes: 2
Views: 1271
Reputation: 19471
The ReactiveElasticsearchTemplate
has aggregate
methods.
See the corresponding API interface
There is no combination of the single entities in a flux and the aggregations in the reactive part.
Upvotes: 2