# setShouldStoreResult doesn't store the tasks results

**URL:** <https://discuss.elastic.co/t/setshouldstoreresult-doesnt-store-the-tasks-results/101112>\
**Category:** Elasticsearch\
**Created:** [September 20, 2017, 6:42am UTC](https://discuss.elastic.co/t/setshouldstoreresult-doesnt-store-the-tasks-results/101112 "2017-09-20T06:42:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![an.secure](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@an.secure](https://discuss.elastic.co/u/an.secure)\
**Post date:** [September 20, 2017, 6:42am UTC](https://discuss.elastic.co/t/setshouldstoreresult-doesnt-store-the-tasks-results/101112/1 "2017-09-20T06:42:35Z")

</div>

I am trying to run a reindex job in async mode using reindexRequestBuilder.execute() method.  
I have also set reindexRequestBuilder.setShouldStoreResult(true) so that I can retrieve the results later on. Also I have set the number of slices to 8.  
When I query the tasks using below command I get the lists of tasks:  
curl 'localhost:9200/\_tasks?detailed=true&actions=\*reindex&pretty'

After the reindex is complete, when I try to get the details for a particular task using the below api, I get an error :

curl 'localhost:9200/\_tasks/c9abi7KWRq-MyzWk7xpAYU:123?pretty'

"error" : {  
"root\_cause" : [  
{  
"type" : "index\_not\_found\_exception",  
"reason" : "no such index",  
"index\_uuid" : "_na_",  
"resource.type" : "index\_expression",  
"[resource.id](http://resource.id)" : ".tasks",  
"index" : ".tasks"  
}  
],  
"type" : "resource\_not\_found\_exception",  
"reason" : "task [c9abi7KWRq-MyzWk7xpAYU:123] isn't running and hasn't stored its results",  
"caused\_by" : {  
"type" : "index\_not\_found\_exception",  
"reason" : "no such index",  
"index\_uuid" : "_na_",  
"resource.type" : "index\_expression",  
"[resource.id](http://resource.id)" : ".tasks",  
"index" : ".tasks"  
}  
},  
"status" : 404  
}

Am I missing something here?

@nik9000 any pointers would be very helpful.

---

<div class="post-metadata">

**Author:** ![an.secure](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@an.secure](https://discuss.elastic.co/u/an.secure)\
**Post date:** [September 20, 2017, 12:44pm UTC](https://discuss.elastic.co/t/setshouldstoreresult-doesnt-store-the-tasks-results/101112/2 "2017-09-20T12:44:40Z")

</div>

Elasticsearch used is version 5.1.1

---

<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:** [October 18, 2017, 12:45pm UTC](https://discuss.elastic.co/t/setshouldstoreresult-doesnt-store-the-tasks-results/101112/3 "2017-10-18T12:45:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
