Coming from this Stack Overflow question:
Currently the value of a @Query annotation or a namedQuery property is sent to Elasticsearch with a wrapper query which only accepts the query definition.
But a search request can have addition info like aggregations (aggs).
It might be possible to define these as well in the annotation or the properties file, so that the string in these contains more than just the query part.
Problems to solve:
- This must not break the existing functionality
- We need a different way than a wrapper query to send this
- Spring Data Elasticsearch must still have the possibility to add fields to the data like offset and size
This needs some more investigation.