1、先将原索引进行备份

curl -XPOST '192.168.46.163:9200/_reindex?pretty' -H 'Content-Type: application/json' -d'

{

  "source": {

    "index": "t_finger"

  },

  "dest": {

    "index": "t_finger180131"

  }

}'

 

2、创建新索引

 

curl -XPUT 192.168.46.163:9200/t_finger

curl -XPUT 192.168.46.163:9200/t_finger/_mapping/t_finger?pretty -d '{

         "properties":{

                   "deviceId":{"type":"string"},

                   "fingerId":{"type":"string"},

                   "clientId":{"type":"string"},

                   "browser":{"type":"string"},

                   "ip":{"type":"string"},

                   "country":{"type":"string","index":"not_analyzed"}

    }

}'

3、迁移数据到新建索引

curl -XPOST '192.168.46.163:9200/_reindex?pretty' -H 'Content-Type: application/json' -d'

{

  "source": {

    "index": "t_finger180131"

  },

  "dest": {

    "index": "t_finger"

  }

}'

 

相关文章:

  • 2021-12-24
  • 2021-11-20
  • 2021-05-29
  • 2021-06-04
  • 2021-05-14
  • 2022-12-23
猜你喜欢
  • 2022-03-05
  • 2021-06-23
  • 2021-11-25
  • 2022-02-09
  • 2021-06-27
  • 2022-01-29
相关资源
相似解决方案