我只想知道有没有办法从elasticsearch中的映射中删除一个字段?
请找到以下详细信息,以便您了解我到底想要做什么。
下面是我用来创建索引的脚本,名称为test_index
带有类型名称的映射test_type
。
curl -XPUT 'http://elasticsearch_host:9200/test_index' -d '{
"mappings": {
"test_type": {
"properties":{
"field1":{
"index":"not_analyzed",
"type":"string"
},
"field2":{
"properties":{
"sub_field1":{
"index":"not_analyzed",
"type":"string"
}, "sub_field2":{
"index":"not_analyzed",
"type":"string"
}
}
}
}
}
}
}'
执行上述脚本后,我可以根据指定的映射看到创建的索引,并且我还可以添加新字段。
如果想sub_field2
从field2
映射中的属性中删除,有没有办法做到这一点(或者有没有办法覆盖整个field2
属性)?