I'm working on an application that uses the Elasticsearch .NET client libraries (Elasticsearch.Net and NEST) and, as part of a conversion from Elasticsearch 1.x to 2.x, I'm trying to work out the 2.x equivalents of some data that was previously exposed via IElasticSearchResponse
.
In our 1.x implementation, we carried out the following logic inside a method that was supplied to ConnectionSettings.SetConnectionStatusHandler()
:
private static void LogElasticSearch1DotXMetrics(IElasticsearchResponse resp)
{
if (resp.NumberOfRetries > 0)
PerformSomeLoggingOperationOn(resp.NumberOfRetries);
}
In 2.x, I believe that the equivalent to ConnectionSettings.SetConnectionStatusHandler()
is to pass a method to ConnectionSettings.OnRequestCompleted()
. This method will receive an IApiCallDetails
instance.
private static void LogElasticSearch2DotXMetrics(IApiCallDetails details)
{
PerformSomeLoggingOperationOn(details.??????);
}
I haven't been able to find an obvious equivalent for IElasticSearchResponse.NumberOfRetries
on IApiCallDetails
. Can anyone point me in the right direction?