#Aggregations with Elastic Search ??

3 messages · Page 1 of 1 (latest)

grim sage
#

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

native elmBOT
#

This post has been reserved for your question.

Hey @grim sage! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.