当前位置: 首页 > 工具软件 > Npoi.Mapper > 使用案例 >

ES修改索引,修改mapper数据类型,修改kibanan Mapping conflict

宰父疏珂
2023-12-01

 

1.获取索引的数据类型结构mapping

GET self-2020.04.17/_mapping
GET self-2020.04.17-new/_mapping

2.创建新的索引,修改数据类型

PUT self-2020.04.17-new
{
  "mappings": {
    "doc": {
      "properties": {
        "tokenCreTimeStr": {
          "type":   "date"
           
        }
      }
    }
  }
}

3.拷贝数据

POST _reindex                   
{
  "source": {
    "index": "self-2020.04.17"
  },
  "dest": {
    "index": "self-2020.04.17-new"
  }
}

4.删除旧的索引

DELETE self-2020.04.17

5.设置新的索引别名

POST /_aliases
  {
        "actions": [
            {"add": {"index": "self-2020.04.17-new", "alias": "self-2020.04.17"}}
        ]
  }

 

 

 类似资料: