# Reindex creating a lot of deleted documents

**URL:** <https://discuss.elastic.co/t/reindex-creating-a-lot-of-deleted-documents/178405>\
**Category:** Elasticsearch\
**Created:** [April 25, 2019, 9:10am UTC](https://discuss.elastic.co/t/reindex-creating-a-lot-of-deleted-documents/178405 "2019-04-25T09:10:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer-g](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@developer-g](https://discuss.elastic.co/u/developer-g)\
**Post date:** [April 25, 2019, 9:10am UTC](https://discuss.elastic.co/t/reindex-creating-a-lot-of-deleted-documents/178405/1 "2019-04-25T09:10:10Z")

</div>

Hello,

I've been doing a bit reindexing on my cluster to change the analyser type on a field. No other settings are changed.

To clarify:  
index AAA is the source and BBB is the destination.

AAA has a field called data with the following mapping:  
"data": {  
"type": "text",  
"analyzer": "my\_analyzer"  
},  
I create a brand new index BBB and copy the mapping from AAA exactly apart from a change to the data field. e.g.  
PUT BBB  
{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 5,  
"number\_of\_replicas" : 0  
}  
}  
}

PUT BBB/\_mapping/doc  
{  
"properties": {  
//all other mappings the same  
"data": {  
"type": "text"  
}  
}  
}

I then run  
POST \_reindex  
{  
"source": {  
"index": "AAA"  
},  
"dest": {  
"index": "BBB"  
}  
}

I get a lot of docs.deleted yet I get no errors. Indexing shows a rate of 20K/s though after 24h my doc count was only 20Million in the new index. When I went to cancel the task there was a large amount of reindex tasks (this may or may not be normal after 24h)

Can you help me understand what this means and point me in the right direction to investigate why I'm getting deleted docs in the new index.

I processed 1.7Billion records from 3 other indexes last week just fine using the same process. I have 3 indexes with around 400M in each that show these symptoms but I can't figure out why.

Thanks.

---

<div class="post-metadata">

**Author:** ![developer-g](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@developer-g](https://discuss.elastic.co/u/developer-g)\
**Post date:** [April 26, 2019, 7:18am UTC](https://discuss.elastic.co/t/reindex-creating-a-lot-of-deleted-documents/178405/3 "2019-04-26T07:18:12Z")

</div>

If anyone else comes across this issue I resolved it by adding the version type as external to the reindex command like so.

POST \_reindex  
{  
"source": {  
"index": "AAA"  
},  
"dest": {  
"index": "BBB",  
"version\_type": "external"  
}  
}

This took the indexing speed from 16K/s down to around 5K/s but it completed with no docs.deleted in the destination index.

Can anyone help me understand this issue? Do I somehow have duplicates in my data? I let elasticsearch manage the ids of my documents, could this be something I need to investigate?

Any pointers would be appreciated.

---

<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:** [May 24, 2019, 7:18am UTC](https://discuss.elastic.co/t/reindex-creating-a-lot-of-deleted-documents/178405/4 "2019-05-24T07:18:14Z")

</div>

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