首页 > 移动平台 > 详细

es 修改 mapping 字段类型

时间:2019-08-30 19:04:22      阅读:1372      评论:0      收藏:0      [点我收藏+]

一、原索引

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 字段类型

原文:https://www.cnblogs.com/royfans/p/11436395.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!