Hey! so im currently working on a project using spring and elastic search to get data from our database. this is my first project working with both of these things. From what i have gathered on stack overflow and chatgpt the way to do this wouldve been something like this?
SearchResponse response = client.search( request -> request
.index("teachers")
.size(0)
.aggregations(aggs -> aggs
.terms("countries", AggregationBuilders.terms("countries").field("country.keyword"))
, Teacher.class);
I have setup the latest version of elastic search - 8.7.1. Which means the above REST client has been depricated. I've been trying to read through the Elastic Docs to try and understand how the new approch works but i do not understand it will enough.
Has anyone used aggregations since the deprication and would be willing to give me any help on this issue