ebuildy
(Thomas Decaux)
December 5, 2016, 3:45pm
1
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 ;/
nik9000
(Nik Everett)
December 5, 2016, 4:21pm
2
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"
}
}
2 Likes
system
(system)
Closed
January 2, 2017, 4:21pm
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.