POST /_reindex
{
"source": {
"remote": {
"host": "http://{SOURCE_IP}:9200"
},
"index": "{INDEX_NAME_SOURCE}"
},
"dest": {
"index": "{INDEX_NAME_DESTINATION}"
}
}
มีจุดสำคัญคือ ถ้า Index เราก้อนใหญ่ไป มันจะขึ้น Error ประมาณว่า
Remote responded with a chunk that was too large.
ให้เพิ่ม size
เข้าไป แบบนี้
POST /_reindex
{
"source": {
"remote": {
"host": "http://{SOURCE_IP}:9200"
},
"size": 100,
"index": "{INDEX_NAME_SOURCE}"
},
"dest": {
"index": "{INDEX_NAME_DESTINATION}"
}
}
มันจะแตกการนำเข้า เป็น batche
ละ 100 document ทำให้ขนาดไม่เกิน limit แต่ถ้ามันไม่เกิน limit การส่งไป รวดเดียว จะเร็วกว่า