Elasticsearch

ES重建索引

2018-03-14  本文已影响425人  alonwang

适用于现有索引需要增加一个字段或修改类型

  1. 更新模板
    PUT /_template/xxx
  2. 建立新索引
    PUT /xxx
  3. 重建索引
POST _reindex
{
  "source": {
    "index": "old"
  },
  "dest": {
    "index": "new"
  }}
  1. 转移别名
POST /_aliases
{
    "actions": [
        { "remove": { "index": "old", "alias": "xxx" }},
        { "add":    { "index": "new", "alias": "xxx" }}
    ]}
上一篇 下一篇

猜你喜欢

热点阅读