# How to create SearchResponse from json object

**URL:** <https://discuss.elastic.co/t/how-to-create-searchresponse-from-json-object/181988>\
**Category:** Elasticsearch\
**Created:** [May 21, 2019, 11:48am UTC](https://discuss.elastic.co/t/how-to-create-searchresponse-from-json-object/181988 "2019-05-21T11:48:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gangakrishhh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gangakrishhh/32/46551_2.png) [@gangakrishhh](https://discuss.elastic.co/u/gangakrishhh)\
**Post date:** [May 21, 2019, 11:48am UTC](https://discuss.elastic.co/t/how-to-create-searchresponse-from-json-object/181988/1 "2019-05-21T11:48:12Z")

</div>

Hi All,

I'm trying convert the json response to SearchResponse.. with this solution [https://stackoverflow.com/questions/25425243/create-dummy-searchresponse-instance-for-elasticsearch-test-case](https://stackoverflow.com/questions/25425243/create-dummy-searchresponse-instance-for-elasticsearch-test-case) it is working for simple response without Aggregations.. how do we achieve with Aggregation.

Thanks in Advance

---

<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:** [June 18, 2019, 11:48am UTC](https://discuss.elastic.co/t/how-to-create-searchresponse-from-json-object/181988/2 "2019-06-18T11:48:12Z")

</div>

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