Skip to content

Commit

Permalink
Additional logs for ElasticSearch failures
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreySurkov committed Aug 14, 2024
1 parent 73ad378 commit 47ecc6f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ public async Task<string> GetIndexMappings(string indexName)
{
var response = await _elasticClient.LowLevel.Indices.GetMappingAsync<StringResponse>(GetFullIndexName(indexName));

if (!response.Success)
{
_logger.LogWarning("There were issues retrieving index mappings from Elasticsearch. {OriginalException}", response.OriginalException);
}

return response.Body;
}

Expand Down Expand Up @@ -333,7 +338,7 @@ public async Task<bool> DeleteDocumentsAsync(string indexName, IEnumerable<strin

if (response.Errors)
{
_logger.LogWarning("There were issues deleting documents from Elasticsearch. {result.OriginalException}", response.OriginalException);
_logger.LogWarning("There were issues deleting documents from Elasticsearch. {OriginalException}", response.OriginalException);
}

success = response.IsValid;
Expand Down Expand Up @@ -427,7 +432,7 @@ public async Task StoreDocumentsAsync(string indexName, IEnumerable<DocumentInde

if (result.Errors)
{
_logger.LogWarning("There were issues reported indexing the documents. {result.ServerError}", result.ServerError);
_logger.LogWarning("There were issues reported indexing the documents. {ServerError}", result.ServerError);
}
}
}
Expand Down

0 comments on commit 47ecc6f

Please sign in to comment.