令my-index-0为 ES 索引,别名为my-index。
它具有以下映射:
{
"my-index-0": {
"aliases": {
"my-index": {}
},
"mappings": {
"doc": {
"properties": {
"foo": {
"properties": {
"fizz": {
"type": "keyword"
},
"baz": {
"type": "keyword"
}
}
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
假设我想baz从 中删除该字段foo。我正在使用以下步骤:
my-index-1使用更新的映射(foo.baz已删除)创建新索引PUT /my-index-1{
"mappings": {
"doc": {
"properties": {
"foo": {
"properties": {
"fizz": {
"type": "keyword"
},
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
my-index-0为 …