Efficient way to replace all content of a cluster

Hello Elastic experts,

If I want to replace all content of a cluster, wondering what is the most efficient way? Is there any mode of clean-up everything and batch insert new records afterwards?

thanks in advance,
Lin

DELETE index

Then reindex

If you have enough disk you can index in a new index then switch the alias (if you have one) and delete the old one.

Hi David,

I am interested in this solution, "If you have enough disk you can index in a new index then switch the alias (if you have one) and delete the old one.", any referred documents? Thanks.

regards,
Lin

https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html

This is the exact solution I am looking for, thanks David.