码迷,mamicode.com
首页 > 移动开发 > 详细

es 修改 mapping 字段类型

时间:2019-08-30 18:42:17      阅读:1408      评论:0      收藏:0      [点我收藏+]

标签:put   类型   cti   doc   别名   orm   text   ext   pre   

一、原索引

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

标签:put   类型   cti   doc   别名   orm   text   ext   pre   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!