I'm not able to find some example and I even didn't get the point if such thing is possible or I should switch to low level client (and in this case I'm wondering what the role of org.elasticsearch.index.reindex.DeleteByQueryRequest is) .
If you use the low-level REST client instead, I don't think that DeleteByQueryRequest will help. You need to provide the request body as a string or byte array as part of an HttpEntity (that's what the apache http client calls it). Maybe for the query part you can reuse the SearchRequest or SearchSourceBuilder and print out its state using the toXContent method though.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.