Hey,
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();
debugSearchSource.toXContent(content, null);
And finally, get the search json with a call like:
content.string();
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.
Pushed SearchRequestBuilder#internalBuilder(). Note, this should only be
used in debug mode, and only make sense when generation json and not the
binary smile format (on it I will post in a minute).
Hey,
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();
debugSearchSource.toXContent(content, null);
And finally, get the search json with a call like:
content.string();
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.
Pushed SearchRequestBuilder#internalBuilder(). Note, this should only be
used in debug mode, and only make sense when generation json and not the
binary smile format (on it I will post in a minute).
Hey,
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();
debugSearchSource.toXContent(content, null);
And finally, get the search json with a call like:
content.string();
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.
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.