To change mappings and reindex elasticsearch data with zero downtime:
- Create an alias that using to search for model (this point to whatever index we want)
- Point this alias to old index (avoid app crash when code change)
- Create new index + import data to this index
- Point our alias to new index
- Delete old index
# Add alias user_docs to users index
curl -XPUT 'localhost:9200/users/_alias/user_docs?pretty'