es的字段属性修改
在存在数据的情况下,无法直接修改字段,所以考虑搬数据
方案1:
搬迁数据导新索引-》删除原来索引或者对原来的索引进行修改-》删除的情况下进行创建索引-》将原来的数据搬迁到新索引
方案2
搬迁数据导新索引-》删除原来索引-》启动项目-》将原来的数据搬迁到新索引
这里采用方案2,
搬迁数据导新索引
post _reindex
{
"source": {
"index": "custom_resource"
},
"dest": {
"index": "custom_resource1",
"op_type": "create"
}
}
删除原来索引
DELETE custom_resource
将原来的数据搬迁到新索引
post _reindex
{
"source": {
"index": "custom_resource1"
},
"dest": {
"index": "custom_resource"
}
}