Extract request JSON from MultiGetRequestBuilder

Using the Java client, it's possible to obtain the generated request JSON
from the SearchRequestBuilder merely by calling toString():

  LOGGER.debug("Executing query:\n" + searchRequestBuilder.toString());

We also have some code that uses the MultiGetRequestBuilder to retrieve
specific documents by ID, so I added a line to do the same thing:

  LOGGER.debug("Executing query:\n" + multiGetRequestBuilder.toString

());

Problem is, MultiGetRequestBuilder does not override toString() to provide
a similar capability. Is there another way to extract the JSON from the
request builder? I haven't hit on anything so far. We're on version
0.19.9. Any suggestions?

Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I don't see it in the most recent version 0.90.0 either. :frowning:

On Wednesday, May 8, 2013 7:41:47 PM UTC-4, Mark Mindenhall wrote:

Using the Java client, it's possible to obtain the generated request JSON
from the SearchRequestBuilder merely by calling toString():

  LOGGER.debug("Executing query:\n" + searchRequestBuilder.toString

());

We also have some code that uses the MultiGetRequestBuilder to retrieve
specific documents by ID, so I added a line to do the same thing:

  LOGGER.debug("Executing query:\n" + multiGetRequestBuilder.toString

());

Problem is, MultiGetRequestBuilder does not override toString() to provide
a similar capability. Is there another way to extract the JSON from the
request builder? I haven't hit on anything so far. We're on version
0.19.9. Any suggestions?

Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Can you open an issue?

I think we just need to add:

@Override
public String toString() {
    return internalBuilder().toString();
}

In MultiGetRequestBuilder and MultiSearchRequestBuilder as well.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 9 mai 2013 à 01:41, Mark Mindenhall mmindenhall@gmail.com a écrit :

Using the Java client, it's possible to obtain the generated request JSON from the SearchRequestBuilder merely by calling toString():

  LOGGER.debug("Executing query:\n" + searchRequestBuilder.toString());

We also have some code that uses the MultiGetRequestBuilder to retrieve specific documents by ID, so I added a line to do the same thing:

  LOGGER.debug("Executing query:\n" + multiGetRequestBuilder.toString());

Problem is, MultiGetRequestBuilder does not override toString() to provide a similar capability. Is there another way to extract the JSON from the request builder? I haven't hit on anything so far. We're on version 0.19.9. Any suggestions?

Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.