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"
          }
        }
      ]
    }
    

      

  • 相关阅读:
    洛谷P3406 海底高铁[差分 贪心]
    POJ3398Perfect Service[树形DP 树的最大独立集变形]
    POJ3928Ping pong[树状数组 仿逆序对]
    UVALive
    UVALive
    http协议进阶(二)URL与资源
    http协议进阶(一)HTTP概述
    http协议基础(十)实体首部字段
    http协议基础(九)响应首部字段
    http协议基础(八)请求首部字段
  • 原文地址:https://www.cnblogs.com/DomoYao/p/14549055.html
Copyright © 2011-2022 走看看