Can re-index be used to "copy" an index?

Hi,

Can I use re-index to clone one whole index A into index B?

Using elasticsearch python API.

Thanks,
hj

in plain word yes

Can you please give me some documentation or other resource to back this up?

Assuming you've made no changes to your index templates, the basic reindex example on the Reindex API page would result in a copy of the existing index.

Just make sure your new index uses the same index template as the previous index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

So, if your index template matches on twitter_*

POST _reindex
{
"source": {
"index": "twitter_old"
},
"dest": {
"index": "twitter_new"
}
}

Should result in a copy of twitter_old in twitter_new.

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