zoukankan      html  css  js  c++  java
  • ES怎么进行字段添加索引,并保留原有数据

    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"

      }

    }'

     

  • 相关阅读:
    [COCI2013]DLAKAVAC
    [TJOI2013]最长上升子序列
    AGC040E Prefix Suffix Addition
    AGC010E Rearranging
    AGC021F Trinity
    AGC002F Leftmost Ball
    JOISC2019D ふたつのアンテナ
    LOJ6210 「美团 CodeM 决赛」tree
    Luogu P3781 [SDOI2017]切树游戏
    Problem. M
  • 原文地址:https://www.cnblogs.com/atomicbomb/p/8391606.html
Copyright © 2011-2022 走看看