es修改mapping

1.备份数据

POST _reindex?wait_for_completion=false&scroll=10m                   
{
  "source": {
    "index": "数据索引",
    "size": 10000
  },
  "dest": {
    "index": "备份索引"
  }
}

2.查看任务

GET _tasks?detailed=true&actions=*reindex

3.删除旧的索引

DELETE 数据索引

4.创建新的索引

PUT 备份索引

5.修改最大字段数限制(可以不做)

# 修改所有索引的字段限制
PUT _all/_settings
{
  "index.mapping.total_fields.limit": 200000
}

# 修改单一索引的字段限制
PUT 索引名/_settings
{
  "index.mapping.total_fields.limit": 200000
}

6.创建新的数据索引mapping

POST 数据索引/_mapping
{

  "properties": {
      索引字段属性
  }

}

7.数据还原回来

POST _reindex?wait_for_completion=false&scroll=10m                   
{
  "source": {
    "index": "备份索引",
    "size": 10000
  },
  "dest": {
    "index": "数据索引"
  }
}

  

posted @ 2022-11-16 11:15  NAVYSUMMER  阅读(218)  评论(0)    收藏  举报
交流群 编程书籍