舉例子:索引A為舊索引逾一,索引B為新索引铸本。
1、獲取A索引(舊索引)的數(shù)據(jù)結(jié)構(gòu)
GET /index_a/_mapping/
mappings.png
2遵堵、創(chuàng)建一個(gè)新的索引B箱玷,結(jié)構(gòu)同A。
POST /index_b/_mapping/
{
"properties" : {
"age" : {
"type" : "long"
},
"education" : {
"type" : "text"
},
"other": {
"type": "text"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"testedu" : {
"type" : "text"
}
}
}
3陌宿、遷移數(shù)據(jù)
POST _reindex
{
"source": {
"index": "index_a"
},
"dest": {
"index": "index_b"
}
}