# Java API for multiple sub-aggregations

**URL:** <https://discuss.elastic.co/t/java-api-for-multiple-sub-aggregations/17321>\
**Category:** Elasticsearch\
**Created:** [May 2, 2014, 7:29pm UTC](https://discuss.elastic.co/t/java-api-for-multiple-sub-aggregations/17321 "2014-05-02T19:29:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saravanan\_Shanmugasu](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Saravanan\_Shanmugasu](https://discuss.elastic.co/u/Saravanan_Shanmugasu)\
**Post date:** [May 2, 2014, 7:29pm UTC](https://discuss.elastic.co/t/java-api-for-multiple-sub-aggregations/17321/1 "2014-05-02T19:29:31Z")

</div>

Hi,

I am trying to find out the JAVA API that supports nested sub-aggregations in ES. However, the current API's doesn't provide the clear implementation.

Req: property1 , property 2 .... property n

Using TermBuilder, when i tried adding the subAggregation of subAggregation, its getting added into the TermsBuilder as list of sub-aggregrations rather than nested sub-aggregations.

Thanks,  
Saravanan.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:32am UTC](https://discuss.elastic.co/t/java-api-for-multiple-sub-aggregations/17321/2 "2017-07-06T01:32:02Z")

</div>


