-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Currently Spring Data Elasticsearch returns aggregations in the SearchHits
object as the original Aggregations
class from the Elasticsearch libraries.
With the upcoming client changes we cannot use this class directly in the Spring Data Elasticsearch API anymore, as different clients will return different aggregation classes.
One solution would be to provide our own aggregation classes and map the ones from the clients onto these. But in Elasticsearch there are more than 80 different classes in this context and these are also evolving permanently. Trying to keep a mapping up to date will be a maintenance nightmare.
So we will introduce an interface AggregationContainer<T>
where T
is the concrete aggregations class from the used client library in the Spring Data Elasticsearch API. The code for the different clients will then provide concrete implementations of this interface and will return it to the caller. It's then the callers responsibility to use the classes from the chosen client implementation.