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

      

  • 相关阅读:
    webpack查缺补漏
    使用express、react、webpack打包、socket.io、mongodb、ant.design、less、es6实现聊天室
    理解restful 架构 && RESTful API设计指南
    socket.io
    数学图形(1.7)圆内旋轮线
    数学图形(1.6)抛物线
    数学图形(1.5)克莱线
    数学图形(1.4)心形线
    数学图形(1.3)旋轮线
    数学图形(1.2)Sin曲线
  • 原文地址:https://www.cnblogs.com/DomoYao/p/14549055.html
Copyright © 2020-2023  润新知