rollupSearch with new Java Api Client

I am struggling to use the new rollupSearch API.
I am trying to map this query:

GET count_rollup/_rollup_search
{
  "size": 0,
  "aggregations": {
    "timeline": {
      "date_histogram": {
        "field": "datetime",
        "calendar_interval": "1d"
      },
      "aggs" : {
        "parent_name" : {
          "terms": {
            "field": "first_name.keyword",
            "include": "bob"
          },
          "aggs": {
            "lastname_count" : {
              "terms" : {
                "field" : "last_name.keyword"
              }
            }
          }
        }
      }
    }
  }
}

In just trying to get the first level aggregation done:

            RollupSearchResponse<Object> results = elasticsearchClient.rollup().rollupSearch(_0 -> _0
                            .index(elasticSearchConfigBean.indexName())
                            .aggregations(""parent_name", _3 -> _3
                                    .terms(_4 -> _4
                                            .field("first_name.keyword")
                                    )
                            )
                            .size(0),
                    Object.class);

I get the following exception: Property name 'parent_name' is not in the 'type#name' format. Make sure the request has 'typed_keys' set

Also can't figure out how to apply the "include".

Any tips or pointers to an example is greatly appreciated.

Thanks,

Randy

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