# Find failed indexquest in bulk load

**URL:** <https://discuss.elastic.co/t/find-failed-indexquest-in-bulk-load/62537>\
**Category:** Elasticsearch\
**Created:** [October 8, 2016, 12:15am UTC](https://discuss.elastic.co/t/find-failed-indexquest-in-bulk-load/62537 "2016-10-08T00:15:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdaYang](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AdaYang](https://discuss.elastic.co/u/AdaYang)\
**Post date:** [October 8, 2016, 12:15am UTC](https://discuss.elastic.co/t/find-failed-indexquest-in-bulk-load/62537/1 "2016-10-08T00:15:50Z")

</div>

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](http://indReq.id)()); -- this id is null, can't match to the id in the response \_**  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 8, 2016, 1:22am UTC](https://discuss.elastic.co/t/find-failed-indexquest-in-bulk-load/62537/2 "2016-10-08T01:22:19Z")

</div>

They come back in the same order as you send them. Use the index in the  
response array.

---

<div class="post-metadata">

**Author:** ![AdaYang](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AdaYang](https://discuss.elastic.co/u/AdaYang)\
**Post date:** [October 8, 2016, 1:26am UTC](https://discuss.elastic.co/t/find-failed-indexquest-in-bulk-load/62537/3 "2016-10-08T01:26:04Z")

</div>

oh... interesting,, didn't find out that.. thank you very much.

In TransportBulkAction.java,  
this.allowIdGeneration = this.settings.getAsBoolean("action.bulk.action.allow\_id\_generation", true);

I am trying the "action.bulk.action.allow\_id\_generation" and still not work. Thought I am missing something..

Again thank you very much!

Have a nice weekend!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/find-failed-indexquest-in-bulk-load/62537/4 "2017-07-05T22:13:57Z")

</div>


