Multi-level bucket aggregation using High-level Java Client

(Naveengauba) #1


I have written a java web app to display data from an Elastic Search repository. Both the Elastic Search Server and Elasticsearch-rest-high-level-client are at version 6.2.4.

I have a question regarding the Bucket Aggregations. I have a requirement to find out min and max aggregations based on 2 terms.

Here is how the a sample record in my index looks like
"edge": "edge123",
"subnet": "",
"@timestamp": 1535755320000,
"errors": 2

I need to aggregate the data over 1 hour and find out the maximum and minimum number of errors for each "edge + subnet" combination. I am able to write the ES query using the CURL command which uses a bucket aggregation (on subnet) insider another bucket aggregation (on edge) and then applies the min and max aggregation. However I could not find any documentation around this using the High-level Java Client. Has anybody faced similar issues. Please help if you have any suggestions here.


Naveen Gauba

(Naveengauba) #2

I was able to solve the issue based on the solution provided here Aggregation on Searcresult with terms (Buckets inside Buckets)
This issue can be closed now

(system) #3

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