How to find out which request is failing in bulk load when the id needs to be automatically generated? The request id is still null in the listener's afterBulk method, so can't match to the response.getId(). Not sure what I am missing. If I create the IndexRequest with id, I am able to match them. but I do need the id to be generated.
for (T file : files) {
try {
XContentBuilder source = ...
IndexRequest indexRequest = new IndexRequest(indexName, indexType);
bulkProcessor.add(indexRequest.source(source));
} catch (Exception e) {
logger.error("creating indexRequest", e);
}
}
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {
for(ActionRequest actionReq: request.requests()){
IndexRequest indReq = (IndexRequest)actionReq;
_logger.info(indReq.id()); -- this id is null, can't match to the id in the response _
}
}
}