# Reindex a red index (allow\_partial\_search\_results error)

**URL:** <https://discuss.elastic.co/t/reindex-a-red-index-allow-partial-search-results-error/374348>\
**Category:** Elastic Search\
**Created:** [February 11, 2025, 6:36am UTC](https://discuss.elastic.co/t/reindex-a-red-index-allow-partial-search-results-error/374348 "2025-02-11T06:36:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [February 11, 2025, 6:36am UTC](https://discuss.elastic.co/t/reindex-a-red-index-allow-partial-search-results-error/374348/1 "2025-02-11T06:36:21Z")

</div>

hi all  
I have a red index with 5 primary and replica shards which data of shard [2] (both primary and replica) is missed.

I want to reindex my index to a new one using below api in order to change its status from red to green:

```auto
POST _reindex
{
  "source" : {
    "index" : "myindex_2024.02"
  
},

 "dest" : {
   "index": "myindex_new_2024.02"
 }

}

```

the result of reindex api in dev tools is as below:

> {  
> "error": {  
> "root\_cause": ,  
> "type": "search\_phase\_execution\_exception",  
> "reason": "start",  
> "phase": "can\_match",  
> "grouped": true,  
> "failed\_shards": ,  
> "caused\_by": {  
> "type": "search\_phase\_execution\_exception",  
> "reason": "Search rejected due to missing shards [[myindex\_2024.02][2]]. Consider using `allow_partial_search_results` setting to bypass this error.",  
> "phase": "can\_match",  
> "grouped": true,  
> "failed\_shards":   
> }  
> },  
> "status": 503  
> }

based on the search on the Internet, I use below api to handle above issue, but the result of the reindex api is the same and has the same error.

```auto
PUT _cluster/settings
{
    "persistent" : {
        "search.default_allow_partial_results" : true
    }
}

```

how can i handle this issue and trun the status of index from red to green. notably there is no snapshot of the mentioned index.

any help will be so appreciated.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 11, 2025, 6:45am UTC](https://discuss.elastic.co/t/reindex-a-red-index-allow-partial-search-results-error/374348/2 "2025-02-11T06:45:13Z")

</div>

If both the primary and replica is missing it is important to figure out the cause so it can be prevented from happening again. Instead of reindexing you could use the [cluster reroute API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html) to allocate an empty shard to replace the missing shard (see the `allocate_empty_primary` parameter), which may be easier.

---

<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:** [March 11, 2025, 6:45am UTC](https://discuss.elastic.co/t/reindex-a-red-index-allow-partial-search-results-error/374348/3 "2025-03-11T06:45:42Z")

</div>

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