how to rename an index in a cluster?

前端 未结 8 1864
情话喂你
情话喂你 2020-12-07 09:48

I need to rename several indexes in a cluster (their name must be changed, I cannot use aliases).

I saw that there are no supported ways to do that,

8条回答
  •  悲哀的现实
    2020-12-07 10:12

    You can use REINDEX to do that.

    Reindex does not attempt to set up the destination index. It does not copy the settings of the source index. You should set up the destination index prior to running a _reindex action, including setting up mappings, shard counts, replicas, etc.

    1. First copy the index to a new name
    POST /_reindex
    {
      "source": {
        "index": "twitter"
      },
      "dest": {
        "index": "new_twitter"
      }
    }
    
    1. Now delete the Index
    DELETE /twitter
    

提交回复
热议问题