简体   繁体   English

需要在 6.2.4 elasticsearch 中重命名索引

[英]Need to rename index in 6.2.4 elasticsearch

I have used _shrink api and shrinked my index from 5shards to 1 shard but with a different name and have deleted the old index.我使用了 _shrink api 并将我的索引从 5 个分片缩小到 1 个分片,但名称不同,并删除了旧索引。 Now I want to rename the newly created index to the same old name, used _reindex api but that is creating the index with same old 5shards, but want to have it on single primary shard.现在我想将新创建的索引重命名为相同的旧名称,使用 _reindex api 但这是使用相同的旧 5 分片创建索引,但希望将它放在单个主分片上。 Since am in 6.2.4 can't use _clone api.由于在 6.2.4 中无法使用 _clone api。

Please advise.请指教。 TIA TIA

Abhishek阿布舍克

Add the amount of shards at index creation time:在创建索引时添加分片数量:

PUT /my-index-000001
{
  "settings": {
    "index": {
      "number_of_shards": 1
    }
  }
}

You can also add the mapping and other settings in this request.您还可以在此请求中添加映射和其他设置。

See also: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html另请参阅: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM