http://192.168.4.15:9200/_reindex/
POST
{
"source": {
"index": "old_index",
"size":1000 //可选,每次批量提交1000个,可以提高效率,建议每次提交5-15M的数据
},
"dest": {
"index": "en_law"
}
}
注意:如果新index中type名字和老index中不同 ,会报错: Rejecting mapping update to [XXX] as the final mapping would have more than 1 type!!!
注意:如果新index中type名字和老index中不同 ,会报错: Rejecting mapping update to [XXX] as the final mapping would have more than 1 type!!!
注意:如果新index中type名字和老index中不同 ,会报错: Rejecting mapping update to [XXX] as the final mapping would have more than 1 type!!!
1、新index不创建mapping,则老数据进入新index时会由es自动生成对应mapping,不建议这样
2、新index和老index的mapping对应,则可以正常导过去数据
3、新index mapping:a、b包含老index mapping:a 不存在的mapping字段b,则b不受影响,该是什么样导完数据还是什么样
4、老index mapping:a、b包含新index index mapping:a不包含的mapping字段b,且b字段没有内容,则倒完后新index的mapping中不包含b字段(这个在很有用,在mapping创建错误时可以用到)
5、老index mapping:a、b包含新index index mapping:a不包含的mapping字段b,且b字段有内容,则新index中b会根据es默认生成mapping