I'm trying to find the place in the NEST API (or via the underlying ElasticSearch.NET API at the time of using NEST) where I can see the JSON created by a NEST query. This is my problem summed up in a partial code sample -
using NEST;
// create any query
var elasticResponse = elasticClient.Search<Hotel>(s => s
.Query(q => // ... build up the rest of my query ...
elasticResponse.ApiCall.HttpMethod // is "POST" - good!
elasticResponse.ApiCall.HttpStatusCode // is 200 (OKAY) - good!
elasticResponse.ApiCall.Success // is true - good!
// ISSUE:
// I've tried viewing the generated JSON through these members (in no particular order) without success ...
elasticResponse.ApiCall.RequestBodyInBytes // is always empty before and after use of the elasticResponse object.
elasticResponse.ApiCall.DebugInformation // doesn't provide useful info about body.
elasticResponse.CallDetails.RequestBodyInBytes // is always null.
I'm using Elastic Search 2.3.1 and NEST 2.4.1.
The places in which I expect to see the POST data or generated query don't have it; they are either empty or null, and no error condition is showing because the query was successful.
I have also looked through available members of the query descriptor while building up the query, with the thought I might be able to capture the RESTful call body immediately after I finish building the query, but haven't found anything useful yet.
ConnectionSettings turn up a .OnRequestCompletedcallback but that doesn't seem to reveal the query either.
I've skimmed the official documentation to no avail yet. Looking for some help. Thank you.