Tutorials and Examples of Aggregations in the Java High Level Client

Hi,

I'm looking for tutorials and examples of building aggregates using the Java High Level client API.
Google doesn't throw up much, the ES guide is an overview of functionality and the Javadocs just list the API of course.

I'm interested in building bucketed queries of simple things like hourly mean of a field over a time range.

Whilst i can find JSON query samples, I'd like to find some more examples of constructing these using the HL API specifically.

Any pointers appreciated.

Thanks

Hey,

I think your best bet is to look at the AggregationBuilders class in combination with the high level rest client reference documentation, i.e. https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.8/java-rest-high-aggregation-builders.html

Another great resource of learning are the tests (that are used to generate the documentation), see https://github.com/elastic/elasticsearch/blob/master/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java

If there is any more concrete question, feel free to ask!

hope that helps!

--Alex

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.