参考博客:https://www.cnblogs.com/royfans/p/11436395.html

1、修改映射

PUT goods2
{
    "mappings": {
        "_doc": {
            "properties": {
              "good_id": {
                    "type": "integer"
                },
                "orginal_id": {
                    "type": "integer"
                },
                "remark": {
                    "type": "text",
                    "fields": {
                        "raw": {
                            "ignore_above": 256,
                            "type": "keyword"
                        }
                    }
                },
                "create_time": {
                    "type": "date",
                    "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
                }
            }
        }
    }
}

2、同步数据

POST _reindex                   
{
  "source": {
    "index": "goods"
  },
  "dest": {
    "index": "goods2"
  }
}

3、删除之前的index

DELETE goods

4、将修改后的index更名

POST /_aliases
  {
        "actions": [
            {"add": {"index": "goods2", "alias": "goods"}}
        ]
  }

 

相关文章:

  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
猜你喜欢
  • 2021-10-05
  • 2021-12-24
  • 2021-08-24
  • 2022-12-23
  • 2021-09-17
  • 2021-11-08
  • 2022-01-20
相关资源
相似解决方案