1.简单的reindex
source里是源index,dest里是目标索引。remote里必须是在新集群中加入了白名单的ip和port
POST _reindex
{
"source": {
"remote": {
"host": "http://ip:port"
},
"index": "index1"
},
"dest": {
"index": "index2"
}
}
2.只reindex目标索引中缺少的
op_type设置为create,只迁移目标索引中没有但老集群有的数据
POST _reindex
{
"source": {
"remote": {
"host": "http://ip:port"
},
"index": "index1"
},
"dest": {
"index": "index2",
"op_type": "create"
}
}
3.设置批次大小
通过设置size来实现,默认的size是1000
POST _reindex
{
"source": {
"remote": {
"host": "http://ip:port"
},