Re-Indexing API
ElasticSearch API Documentation can be found here
You can copy documents from one index to another by using the Reindex API.
This was useful during beta testing to create a new index with a different shard count and copy all the documents to the new index, without going through the Atlantis-Search indexing process all over again.
We could likely do this in the future when we want to scale to a larger tier and want to increase the shard count. We would need to temporarily scale to a tier that has enough storage to duplicate the index, but once we've reindexed, we could delete the original and scale back down to the desired tier.
Example
POST _reindex?requests_per_second=-1&wait_for_completion=false
{
"source": {
"index": "node-index"
},
"dest": {
"index": "node-index-1",
"routing": "keep"
}
}
requests_per_second
: setting this to-1
makes it so no throttling occurswait_for_completion
: setting this tofalse
makes it so the operation runs asynchronously. (You want to do this)routing
: setting this tokeep
makes it so the_routing
values stays the same as in the source. We do use routing so you will want to make sure this is set.
No Comments