# Get JSON from Java SearchRequest.Builder

**URL:** <https://forum.opensearch.org/t/get-json-from-java-searchrequest-builder/14314>\
**Category:** OpenSearch\
**Tags:** troubleshoot\
**Created:** [May 11, 2023, 6:01pm UTC](https://forum.opensearch.org/t/get-json-from-java-searchrequest-builder/14314 "2023-05-11T18:01:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc108](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@marc108](https://forum.opensearch.org/u/marc108)\
**Post date:** [May 11, 2023, 6:01pm UTC](https://forum.opensearch.org/t/get-json-from-java-searchrequest-builder/14314/1 "2023-05-11T18:01:21Z")

</div>

When using the elastic search java client (8.5) with a SearchRequest.Builder() there is an easy way to the JSON that will be send to the server it’s just toString() method.  
For the opensearch-java-2.4.0 client this is not working. Is there a way to get the JSON for a SearchRequest. For me this is vital in order to check if my queries are correct.  
Thanks  
Marc
