Datehistogram aggregation query using java api client

Need to convert this to java api client code

Able to create datehistogram aggregation but facing issue in adding metrics sub aggregation(min aggregation in this case) to terms aggregation

can someone assist here?

Please be patient in waiting for responses to your question and refrain from pinging multiple times asking for a response or opening multiple topics for the same question. This is a community forum, it may take time for someone to reply to your question. For more information please refer to the Community Code of Conduct specifically the section "Be patient". Also, please refrain from pinging folks directly, this is a forum and anyone that participates might be able to assist you.

If you are in need of a service with an SLA that covers response times for questions then you may want to consider talking to us about a subscription.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

Sorry about that. I will wait.

Subaggregations in the java client can be added by calling the aggregations method provided in the Aggregation class itself; your example would look something like this: -> s
                .aggregations("dateHistogram", a1 -> a1
                    .dateHistogram(dh -> dh
                    .aggregations("terms", a2 -> a2
                        .terms(ts -> ts
                        .aggregations("aggs", a3 -> a3
                            .min(m -> m
            ,Object.class); worked

1 Like