# Is It Possible To See the JSON Query Generated By QueryBuilder

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-see-the-json-query-generated-by-querybuilder/55618>\
**Category:** Elasticsearch\
**Created:** [July 15, 2016, 1:04pm UTC](https://discuss.elastic.co/t/is-it-possible-to-see-the-json-query-generated-by-querybuilder/55618 "2016-07-15T13:04:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadepo/32/19944_2.png) [@dadepo](https://discuss.elastic.co/u/dadepo)\
**Post date:** [July 15, 2016, 1:04pm UTC](https://discuss.elastic.co/t/is-it-possible-to-see-the-json-query-generated-by-querybuilder/55618/1 "2016-07-15T13:04:41Z")

</div>

Is there any facility when using the QueryBuilder in Java to dump/extract/see the JSON that the builders generates?

---

<div class="post-metadata">

**Author:** ![John\_D\_Ament](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_d_ament/32/764_2.png) [@John\_D\_Ament](https://discuss.elastic.co/u/John_D_Ament)\
**Post date:** [July 15, 2016, 4:59pm UTC](https://discuss.elastic.co/t/is-it-possible-to-see-the-json-query-generated-by-querybuilder/55618/2 "2016-07-15T16:59:18Z")

</div>

Generally speaking, calling toString on the SearchRequestBuilder works.

---

<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, 10:35pm UTC](https://discuss.elastic.co/t/is-it-possible-to-see-the-json-query-generated-by-querybuilder/55618/3 "2017-07-05T22:35:06Z")

</div>


