指点成金-最美分享吧

登录

es 修改 mapping 字段类型

佚名 举报

篇首语:本文由小编为大家整理,主要介绍了es 修改 mapping 字段类型相关的知识,希望对你有一定的参考价值。

一、原索引

PUT my_index  "mappings":     "_doc":       "properties":         "create_date":           "type":   "date",          "format": "yyyy-MM-dd ||yyyy/MM/dd"                              

  二、创建新索引

PUT my_index2  "mappings":     "_doc":       "properties":         "create_date":           "type":   "text"                              

  三、同步数据

POST _reindex                      "source":     "index": "my_index"  ,  "dest":     "index": "my_index2"  

  四、删除原索引

DELETE my_index

  五、设置别名

POST /_aliases          "actions": [            "add": "index": "my_index2", "alias": "my_index"        ]  

  

 

以上是关于es 修改 mapping 字段类型的主要内容,如果未能解决你的问题,请参考以下文章