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"

      }

    }'

     

  • 相关阅读:
    32位二进制IP地址与十进制IP地址互相转换
    在安装AndroidStudio时产生的问题
    Java 数列求和
    Java throws Exception、try、catch
    Java 语句循环
    Oracle OEM
    数据泵Expdp和Impdp
    java查询高斯数据库表某个字段值
    安全测试笔记(未更新完)
    工作笔记
  • 原文地址:https://www.cnblogs.com/atomicbomb/p/8391606.html
Copyright © 2011-2022 走看看