- Elasticsearch: 6.2
Hello.
I am trying to update the mapping of an existing index, by the operations described below.
This operation works well for the index if number of documents are relatively small (e.g. 1,000).
However, if the index has many (e.g. 100,000) documents, 50~90% of documents are lost...
Any help?
Step 1. Update Index template
PUT _template/twitter -d @template_twitter.json
Step 2. Create new temporary index from existing index.
POST _reindex?wait_for_completion=true
{
"source": {
"index": "twitter"
},
"dest": {
"index": "twitter_temp"
}
}
Step 3. Delete old index
DELETE twitter
Step 4. Restore from temporary index.
POST _reindex?wait_for_compretion=true
{
"source": {
"index": "twitter_temp"
},
"dest": {
"index": "twitter"
}
}
Step 5. Delete temporary index.
DELETE twitter_temp
After Step 2,
GET twitter/_stats
and
GET twitter_temp/_stats
returns JSON in which _all.total.docs.count
field are different.
So I guess that I miss something in Step 2 so data losing happens.