【问题标题】:No search hits after moving Elasticsearch index移动 Elasticsearch 索引后没有搜索命中
【发布时间】:2014-11-18 11:26:14
【问题描述】:

我需要将 Elasticsearch 索引从远程主机移动到本地主机。一些研究让我找到了一个名为elasticdump 的工具,它似乎是适合这项工作的工具。按照其 GitHub 页面上的说明,我运行了以下命令:

elasticdump --input=http://remote_host/index_name --ouput=http://localhost/index_name

运行后,本地索引确实包含来自远程索引的文档。但是,当我向本地 Elasticsearch 的搜索 API 提出查询时,我没有得到任何结果,而当向远程 Elasticsearch 的 API 提出相同的查询时,会返回多个命中。

要使本地搜索 API 正常工作需要什么?

【问题讨论】:

  • GET remote_host/index_name/_mapping 是否与 localhost/index_name/_mapping 匹配?文档说它应该复制它,但是检查一下……映射/设置是否还引用了一些外部文件,例如同义词文件或字典文件?是否存在未被复制的别名?磁盘上是否有未复制的脚本?这里没有足够的信息来说明发生了什么。

标签: elasticsearch


【解决方案1】:

现在有一个映射导入/导出标志可以与 elasticdump 一起使用,这可能是问题所在:

  • elasticdump --input=http://production.es.com:9200/my_index --output=http://staging.es.com:9200/my_index --type=mapping
  • elasticdump --input=http://production.es.com:9200/my_index --output=http://staging.es.com:9200/my_index --type=data

【讨论】:

    猜你喜欢
    • 2016-11-26
    • 1970-01-01
    • 2022-06-18
    • 1970-01-01
    • 2017-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-02
    相关资源
    最近更新 更多