I am working on the Elastic Search (v7.10) and see that the statistic metric "indexing.index_failed" has increased. But I want to know the reasons why it failed.
In my application, I used the Rest High-level Client and have caught the exception. But I found that there were no exception have been thrown. So does the index fail affect the insertion?
private IndexResponse insertData(Data data) {
try {
IndexRequest indexRequest = new IndexRequest();
indexRequest.index("index-name");
indexRequest.id(data.getId());
Map<String, Object> jsonMap = mapper.convertValue(data, new TypeReference<>() {});
indexRequest.source(jsonMap);
return esClient.index(indexRequest, RequestOptions.DEFAULT);
} catch (Exception ex) {
log.error("Error: Data={} ", data, ex);
}
}
In my opinion, I think because the work loads on the ES is high, which cause the replication from primary shard is timeout. Have anyone investigate on this? Thank you!
I have checked these document & threads: