Currently using the Java API and am building up a
SearchRequestBuilder object. I see that internally,
SearchRequestBuilder keeps a SearchSourceBuilder member(sourceBuilder)
that is private.
I would like to be able to provide some debug logging that would allow
a developer to copy and paste a curl command to run a query and debug.
In order to do this, I am currently instantiating my own
SearchSourceBuilder and calling the methods on it that
SearchRequestBuilder calls on its own internal sourceBuilder.
Afterwards, I instantiate a BinaryXContentBuilder and populate it with
a call like this:
BinaryXContentBuilder content = jsonBuilder();
And finally, get the search json with a call like:
Is there anyway to get access to the SearchRequestBuilder's
sourceBuilder, so I don't have to mirror the method calls to my copy
or is there a better way to accomplish this that I have overlooked? A
debug method to get the SearchRequestBuilder sourceBuilder as string
or similar would be convenient for this case.