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

      

  • 相关阅读:
    firefox ajax async 弹出窗口提示阻止
    Spring加载resource时classpath*:与classpath:的区别(转)
    超链接的href属性 js调用
    jquery easyui tabs layout 记录
    PostgreSQL 中的递归查询 与oracle 的比较
    将字符串中的中文(英文)字符串转化为阿拉伯数字
    用CSS控制文字的宽度,超过省略号代替(转)
    制作gridview 固定列的2种简单解决方案
    自制树型控件(DataGrid) 支持多种响应
    备忘: select 对象的操作js(转)
  • 原文地址:https://www.cnblogs.com/DomoYao/p/14549055.html
Copyright © 2011-2022 走看看