# Reindexing doesnt work

**URL:** https://discuss.elastic.co/t/reindexing-doesnt-work/262693
**Category:** Elasticsearch
**Created:** [January 29, 2021, 9:55pm UTC](https://discuss.elastic.co/t/reindexing-doesnt-work/262693 "2021-01-29T21:55:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Deny7](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@Deny7](https://discuss.elastic.co/u/Deny7)
#### Post date: [January 29, 2021, 9:55pm UTC](https://discuss.elastic.co/t/reindexing-doesnt-work/262693/1 "2021-01-29T21:55:27Z")

</div>

Hi,

I changed mapping to index so I wanted reindex. I have about 200 daily indicies that I want reindex. I used bellow command. When I ran it gave me 504 timeout error. When I checked `GET /_cat/indices?v` there is created about 100 copies with `-reindexed` at the end. But these indicies are empty and they have **docs.count: 5** and nothing is happening. Their health is green and status is open. When I ran `GET /_tasks?detailed=true&actions=*reindex&group_by=parents` it gives me no tasks. When I check the ES log I see lot of:

> org.elasticsearch.transport.RemoteTransportException: [\*\*\*\*][\*\*\*\*\*:9300][indices:data/read/search[phase/query]]  
> Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: Query Failed [Failed to execute main query]

Can somebody help?

**COMMAND:**

```
POST _reindex
{
  "source": {
    "index": "nginxprx-*"
  },
  "dest": {
    "index": "nginxprx"
  },
  "script": {
    "lang": "painless",
    "source": "ctx._index = 'nginxprx-' + (ctx._index.substring('nginxprx-'.length(), ctx._index.length())) + '-reindexed'"
  }
}

```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 1, 2021, 12:24am UTC](https://discuss.elastic.co/t/reindexing-doesnt-work/262693/2 "2021-02-01T00:24:36Z")

</div>

Can you post more of the Elasticsearch logs?  
Have you tried with just one index?

---

<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 1, 2021, 12:24am UTC](https://discuss.elastic.co/t/reindexing-doesnt-work/262693/3 "2021-03-01T00:24:37Z")

</div>

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