做网站需要备案吗,服装网站建设发展状况,网站开发Z亿玛酷1订制,儿童 html网站模板es字段一旦创建是无法删除的#xff0c;本案的方案是复制新老索引的方法 一、背景
现有索引 index1,待删除字段field1和extendMap.field2#xff0c;es版本6.3.2
二、步骤
1、删除index1中的filed1和extendMap.field2两个字段的数据
POST index1/_update_by_query
{本案的方案是复制新老索引的方法 一、背景
现有索引 index1,待删除字段field1和extendMap.field2es版本6.3.2
二、步骤
1、删除index1中的filed1和extendMap.field2两个字段的数据
POST index1/_update_by_query
{query:{bool:{must:[{exists:{field:field1}}]}},script: ctx._source.remove(field1)}POST index1/_update_by_query
{query:{bool:{must:[{exists:{field:extendMap.field2}}]}},script: ctx._source.extendMap.remove(field2)}
2、新建index2map中不要有上述待删除字段
3、拷贝index1到index2
POST _reindex
{source: {index: index1},dest: {index: index2}
}
4、删除index1
DELETE index1
5、新建index1map中不要有上述待删除字段
6、拷贝index2到index1
POST _reindex
{source: {index: index2},dest: {index: index1}
}
7、删除index2
DELETE index2 完成