# NestedAggregation in co.elastic.clients:elasticsearch-java

**URL:** <https://discuss.elastic.co/t/nestedaggregation-in-co-elastic-clients-elasticsearch-java/363829>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 26, 2024, 7:26am UTC](https://discuss.elastic.co/t/nestedaggregation-in-co-elastic-clients-elasticsearch-java/363829 "2024-07-26T07:26:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)\
**Post date:** [July 26, 2024, 1:18pm UTC](https://discuss.elastic.co/t/nestedaggregation-in-co-elastic-clients-elasticsearch-java/363829/4 "2024-07-26T13:18:57Z")

</div>

Hope it helped! If you're still having issues with aggregations here are some other examples of nested/sub aggregations:

> [@Springdata elasticsearch 5.2 nested aggregation without subAggregation](https://discuss.elastic.co/t/springdata-elasticsearch-5-2-nested-aggregation-without-subaggregation/362052):
>
> Help Needed: Nested Aggregations with Java API Client v8 I'm working on a project using Elasticsearch with the Java API Client v8, and I'm struggling to correctly implement nested aggregations. I'd greatly appreciate any help or guidance. Index Mapping Here's the relevant part of my index mapping: { "actions" : { "mappings" : { "properties" : { "actionRoles" : { "type" : "nested", "properties" : { "roleName" : { "type" : "keywor…

> [@How to create SubAggregation in new JAVA API Client](https://discuss.elastic.co/t/how-to-create-subaggregation-in-new-java-api-client/357529/2):
>
> Hello! I've left out some details, but this is roughly how to translate that kibana query using the new java client, dsl style: esClient.search(s -\> s .index("demo-index") .query(q -\> q .constantScore(cs -\> cs .filter(fl -\> fl .bool(b -\> b .must(...))))) .aggregations("datesAggName",agg -\> agg .dateHistogram(dh -\> dh …

---

_[View the full topic](https://discuss.elastic.co/t/nestedaggregation-in-co-elastic-clients-elasticsearch-java/363829)._
