# Reg Aggregations using Java Client

**URL:** https://discuss.elastic.co/t/reg-aggregations-using-java-client/75861
**Category:** Elasticsearch
**Created:** [February 21, 2017, 10:48am UTC](https://discuss.elastic.co/t/reg-aggregations-using-java-client/75861 "2017-02-21T10:48:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vivred](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@vivred](https://discuss.elastic.co/u/vivred)
#### Post date: [February 21, 2017, 10:48am UTC](https://discuss.elastic.co/t/reg-aggregations-using-java-client/75861/1 "2017-02-21T10:48:26Z")

</div>

Hi,

Earlier in elasticsearch 2.4 version, we used to fetch aggregation json string from DB (agg string used to get added dynamically) and used to set aggregations using setAggregations(bytes[] string) method in java transport client. But now when we updated to 5.0 we found that setAggregations is no longer supported.

Could anyone please help me how to build aggregation from json String. As those aggregation are to be picked up from DB, it is not possible to manually create one using aggregationbuilder.

Regards,  
Vivek

---

<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: [March 21, 2017, 10:48am UTC](https://discuss.elastic.co/t/reg-aggregations-using-java-client/75861/2 "2017-03-21T10:48:55Z")

</div>

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