elasticsearch - 如何使用reindex API重命名索引

标签 elasticsearch reindex

我正在尝试在Elasticsearch上重命名索引,并且按照this question的公认解决方案中的建议,我正在使用Reindex API。我正在使用以下命令:

POST _reindex
{
  "source": {
    "index": "original-index"
  },
  "dest": {
    "index": "new-index"
  }
}

但是我收到以下输出:
{
  "ok": false,
  "message": "Unable to connect to the server."
}

我尝试在执行重新索引之前创建索引,但没有创建索引,每次获取相同的输出时。知道为什么吗?提前致谢。

编辑:
我刚刚再次测试过,它发生了一些奇怪的事情。索引正在重新索引,但错误消息仍在显示。有什么解释吗?该消息令人困惑,原因是它似乎已失败,但是它应该仍在运行...

最佳答案

EDIT: I have just tested it again and it happens something strange. The index is being reindexed, but the error message is still being displayed. Any explanation about that? The message is confusing cause it seems to have failed, but it should be running still...



这是因为套接字读取超时,可以读取more here

默认情况下,当重新索引仍在进行时,读取将在30秒后超时。您可以增加超时以避免此错误。

另外,即使超时,也可以在command to check current progress下使用
GET _tasks?detailed=true&actions=*reindex

关于elasticsearch - 如何使用reindex API重命名索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52373877/

相关文章:

elasticsearch - 如何删除 Elasticsearch 中 Jaeger 的旧索引?

elasticsearch - MAC Elasticsearch 快照位置

python - 如何 "stretch"我的数据帧并在现有值之间进行插值

python - Pandas 多索引系列级别重建索引

postgresql - 如何从命令行重新索引 Postgres 9.1.3

dataframe - 重新索引数据帧时出现问题 : Reindexing only valid with uniquely valued Index objects

database - Elasticsearch对整数字段的最大约束?

django - 使用Haystack构面提供多个搜索字段

php - 如何在Elasticsearch中突出显示我的结果?

python - 使用 pandas reindex 填充缺失的行 "nan"