# JavaApi Json representation differs from http Json representation

**URL:** <https://discuss.elastic.co/t/javaapi-json-representation-differs-from-http-json-representation/215618>\
**Category:** Elasticsearch\
**Created:** [January 19, 2020, 11:28am UTC](https://discuss.elastic.co/t/javaapi-json-representation-differs-from-http-json-representation/215618 "2020-01-19T11:28:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoAbi](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@MarcoAbi](https://discuss.elastic.co/u/MarcoAbi)\
**Post date:** [January 19, 2020, 11:28am UTC](https://discuss.elastic.co/t/javaapi-json-representation-differs-from-http-json-representation/215618/1 "2020-01-19T11:28:57Z")

</div>

Hi all,

I'm using a little BE proxy in nodeJs to redirect FE search request to ES the results I'm getting are like a direct call to http ES endpoint. The result looks like this:

 ![Schermata 2020-01-19 alle 12.21.28](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbdde8dbdb41c47d94c636ff0a0c5a13e9c48f85.png)

where aggregations have names like "2" or, "3", as defined on the query.

However, now I need to change the BE proxy using Java API, and the Json representation of SearchResponse looks like this one

 ![Schermata 2020-01-19 alle 12.21.52](https://us1.discourse-cdn.com/elastic/original/3X/5/5/556157b7ee239674c8e510d15a12830f7031a99e.png)

Where the same aggregation results are with # syntax.

Is there a way to get the original Json Object? Otherwise all the application clients I have needs huge refactoring that is out of scope.

Thanks a lot for you help!  
Marco

---

<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:** [February 16, 2020, 11:29am UTC](https://discuss.elastic.co/t/javaapi-json-representation-differs-from-http-json-representation/215618/2 "2020-02-16T11:29:02Z")

</div>

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