How to print the raw JSON query

Versions (latest):

Describe the issue:
I just want to know if there is a way to print tha raw query JSON

Can you explain more your setup and what you’re trying to do?

I’m using the latest version of the Java client, steps:
1- Create a search request
2- Print the search request in JSON format

I want to know how to perform the 2nd step.

I haven’t tried this, but a little googling revealed this possibility: Log4j 2 Logger | Java Transport Client (deprecated) [7.17] | Elastic

Maybe with “debug” level