How to change the default size of MultiTermAggregation in Java

I was wondering if there is a way to change the default size in MultiTermAggregation in Java,
I can change the default size in dev tools in kibana,
but cannot change the size in java.

Query look like this

GET test_index/_search
{
    "aggs": {
        "multi_terms": {
           "terms": [
             {
               "field": "attributes1"
             },
             {
               "field": "attributes2"
             }
           ],
           "size": 1000
        }
    }
}

And In java I want to define this size but I cannot
Java code:

List<MultiTermLookup> multiTermsList = new ArrayList<>();
multiTermsList.add(MultiTermLookup.of(mt -> mt
              .field("attributes1")
);
multiTermsList.add(MultiTermLookup.of(mt -> mt
              .field("attributes2")
);
Aggregation agg = Aggregation.of(a -> a
                                .multiTerms(mt -> mt
                                      .terms(multiTermsList)
                                      // .size(1000) this is not possible (says "cannot resolve size method in Builder")
                                );

Can you help me out to figure out how to do this, or suggest any other multiTerm aggregation class which also support child aggregation.

Hi!
It seems that others are also having the same question.
I believe that soon the parameters will be added.

Okay,
Thank you :slight_smile:

1 Like

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