I have an index with 3 shards, with default routing.
Now, I want to use a custom route (let says field "userID").
How can I use _reindex API to achieve this?
Thanks you,
PS: I saw there is a routing options for reindex API, but it seems you cannot specify document field in it ;/
You can do it with scripts. It'd look something like:
POST _reindex { "source": { "index": "old" }, "dest": { "index": "new" }, "script": { "inline": "ctx._routing = doc.whatever.value" } }
© 2020. All Rights Reserved - Elasticsearch
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.