Hmm, I am not sure about the usage of ctx variable over indices that belong to a remote cluster. I would be interested in knowing the details about it as well.
However, as a workaround you can take help of the bash script to achieve your objective.
BTW, I digged into the related parts of Es code base.
Maybe unless the name of new index computed by script is different from the original one, a destination won't be changed.
Anyway, thank you for reply, @mjunaidmuzammil
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.