Another situation where you might need to reindex all the documents is when the mapping has changed and a new version
of the application must be redeployed.
#### Upgrading with some downtime
This is the easiest and safest procedure, that I would recommend:
- create a new physical index (let's name it `rare-dev-resource-new-physical-index`);
- delete the `rare-dev-resource-harvest-index` and the `rare-dev-resource-index` aliases, and recreate them both so that they refer to
`rare-dev-resource-new-physical-index`;
- stop the existing application, deploy and start the new one;
- trigger a harvest;
- once everything is running fine, remove the old physical index.
In case anything goes wrong, the two aliases can always be recreated to refer to the old physical index, and the old
application can be restarted.
Here are curl commands illustrating the above scenario:
```
# create a new physical index
curl -X PUT "localhost:9200/rare-dev-resource-new-physical-index" -H 'Content-Type: application/json' -d'
{
"settings": ...
}
'
# delete the `rare-dev-resource-harvest-index` and the `rare-dev-resource-index` aliases, and recreate them both so that they refer to `rare-dev-resource-new-physical-index`
curl -X POST "localhost:9200/_aliases" -H 'Content-Type: application/json' -d'