# Get JSON search DSL from the SearchRequestBuilder

**URL:** <https://discuss.elastic.co/t/get-json-search-dsl-from-the-searchrequestbuilder/38201>\
**Category:** Elasticsearch\
**Created:** [December 30, 2015, 11:11pm UTC](https://discuss.elastic.co/t/get-json-search-dsl-from-the-searchrequestbuilder/38201 "2015-12-30T23:11:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [December 30, 2015, 11:11pm UTC](https://discuss.elastic.co/t/get-json-search-dsl-from-the-searchrequestbuilder/38201/1 "2015-12-30T23:11:12Z")

</div>

Hi when building search DSL using SearchRequestBuilder from the Java client and the various builders. Is it possible to get back the full JSON and without requiring the client?

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [January 4, 2016, 11:17pm UTC](https://discuss.elastic.co/t/get-json-search-dsl-from-the-searchrequestbuilder/38201/2 "2016-01-04T23:17:17Z")

</div>

Hi,

for debugging purposes you can just call toString() on the search request builder instance. But as I said you shouldn't really use this for anything else.

Daniel

---

<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 5, 2017, 11:27pm UTC](https://discuss.elastic.co/t/get-json-search-dsl-from-the-searchrequestbuilder/38201/3 "2017-07-05T23:27:13Z")

</div>


