The docs say:
By default, the client won’t throw on any
ElasticsearchClientException
but instead return an invalid response that can be detected by checking the.IsValid
property on the response. You can change this behaviour with by usingThrowExceptions()
onConnectionSettings
.
How to interpret this? I'd think that enabling ThrowExceptions()
on the connection should always throw an exception when IsValid
would be false
. However, I noticed that this call: await _client.BulkAsync(descriptor, cancellationToken);
does not throw even if it does not succeed (e.g. due to missing index in elasticsearch). The response has IsValid
equal to false
What is the actual relationship between IsValid
and the ThrowExceptions()
setting?