如何重新索引或迁移 elasticsearch 1.x 到 5.x 数据

How to reindex or migrate elasticsearch 1.x to 5.x data

我有旧数据的副本,即 Elasticsearch 1.x,我想在 Elasticsearch 5.x 中迁移或重建索引。

有哪些方法和更好的方法?

Elasticsearch is able to use indices created in the previous major version only. For instance, Elasticsearch 5.x can use indices created in Elasticsearch 2.x, but not those created in Elasticsearch 1.x or before.

If you are running an Elasticsearch 2.x cluster which contains indices that were created before 2.x, you will either need to delete those old indices or to reindex them before upgrading to 5.x. See Reindex in place.

If you are running an Elasticsearch 1.x cluster, you have two options:

First upgrade to Elasticsearch 2.4.x, reindex the old indices, then upgrade to 5.x.

我建议您在此处查看 Elasticsearch 的官方指南 - https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade.html#reindex-upgrade-remote,这应该对您有所帮助。