elasticsearch - 在 ElasticSearch 中重新索引多个索引的最佳方法

标签 elasticsearch elasticsearch-5

我正在使用 Elasticsearch 5.1.1,并使用 ES 提供的默认映射创建了 500 多个索引。

现在我们决定使用动态模板。 为了将此模板/映射应用于旧索引,我需要重新索引所有索引。

最好的方法是什么?我们可以为此使用 Kibana 吗?找不到足够的文档来执行此操作。

最佳答案

示例:从每日索引重新索引到每月索引(8 月)

POST _reindex?slices=10&refresh
{
  "source": {
    "index": "myindex-2019.08.*"
  },
  "dest": {
    "index": "myindex-2019.08"
  }
}

监控重建索引任务(等到完成)

GET _tasks?detailed=true&actions=*reindex

检查是否创建了新索引

GET _cat/indices/myindex-2019.08*?v&s=index

您可以删除旧索引

DELETE myindex-2019.08.*

来源:

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

关于elasticsearch - 在 ElasticSearch 中重新索引多个索引的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44165881/

相关文章:

ElasticSearch 创建索引,索引已经存在异常

elasticsearch - 自定义分析器不工作 Elasticsearch

用于保留(并连接) "and"的 Elasticsearch 分词器

linux - Kibana4 无法通过 IP 连接到 Elasticsearch,只能通过 localhost

java - 用于字段查询的 Elastic search 高级客户端等效项

json - Elasticsearch:批量请求在 Elasticsearch 6.1.1 中抛出错误

elasticsearch - Elasticsearch反向搜索

redis - Logstash、elasticsearch、Kibana,包括IP

elasticsearch - 一个文件可以分成两个桶吗?

laravel - 如何从我的本地计算机访问远程 Elasticsearch 服务器(在 Google Compute Engine 上)