【发布时间】:2020-11-23 13:37:17
【问题描述】:
我有一个包含映射的索引
{
"mappings": {
"properties": {
"title": {
"type": "text"
},
"location": {
"type": "keyword"
}
}
}
}
在location 字段中,我们正在存储城市名称。
我们需要改变映射结构来存储国家和州,所以映射将是
{
"mappings": {
"properties": {
"title": {
"type": "text"
},
"location": {
"properties": {
"country": {
"type": "keyword"
},
"state": {
"type": "keyword"
},
"city": {
"type": "keyword"
}
}
}
}
}
}
这种迁移的推荐流程是什么?
【问题讨论】:
标签: elasticsearch elasticsearch-java-api elasticsearch-mapping