zoukankan      html  css  js  c++  java
  • ES 修改索引步骤

    修改索引字段步骤
    1、新建索引新增字段索引
    PUT biddingindex_new
    {
      "settings": {
        "number_of_shards": 3,
        "number_of_replicas": 1
      },
      "mappings": {
        "properties": {
          "BidMode": {
            "type": "long"
          },
          "LoadStartTime": {
            "type": "date"
          },
          "beginLocation": {
            "type": "geo_point"
          },
          "beginPoint": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "beginPointCity": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "beginPointProvince": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "bussinessSystemCode": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "cargoId": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "cargoType": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "code": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "endLocation": {
            "type": "geo_point"
          },
          "endPoint": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "endPointCity": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "endPointProvince": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "estimatedEndTime": {
            "type": "date"
          },
          "gid": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "isAppointCandidate": {
            "type": "boolean"
          },
          "orderId": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "planEndTime": {
            "type": "date"
          },
          "publishTime": {
            "type": "date"
          },
          "roundsId": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "startTime": {
            "type": "date"
          },
          "status": {
            "type": "long"
          }
        }
      }
    }
    
    2、重建索引
    POST _reindex
    {
      "source": {
        "index": "biddingindex"
      },
      "dest": {
        "index": "biddingindex_new"
      }
    }
    
    3、删除索引:DELETE biddingindex
    
    4、增加新索引别名
    POST _aliases
    {
      "actions": [
        {
          "add": {
            "index": "biddingindex_new",
            "alias": "biddingindex"
          }
        }
      ]
    }
    

      

  • 相关阅读:
    不使用库函数,编写函数int strcmp(char *source, char *dest) 相等返回0,不等返回-1【转】
    atol实现【转】
    atol的实现【转】
    关于内存中栈和堆的区别(非数据结构中的堆和栈,区别)【转】
    ubuntu下安装android模拟器genymotion【转】
    buntu下命令行安装jdk,android-studio,及genymotion虚拟机来进行android开发【转】
    Ubuntu下安装Android studio【转】
    C++模板(二)【转】
    【转】iOS中设置导航栏标题的字体颜色和大小
    【转】Java 截取字符串
  • 原文地址:https://www.cnblogs.com/DomoYao/p/14549055.html
Copyright © 2011-2022 走看看