【问题标题】:Moving mapping from old ElasticSearch to latest ES (5)将映射从旧的 ElasticSearch 迁移到最新的 ES(5)
【发布时间】:2017-06-05 17:21:44
【问题描述】:

我继承了一些在云中某处运行的相当旧的 (v2.something) ElasticSearch 实例,需要从映射到最新 ES (v5) 的本地实例开始获取数据。不幸的是,它失败并出现以下错误:

% curl -X PUT  'http://127.0.0.1:9200/easysearch?pretty=true' --data @easysearch_mapping.json
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "unknown setting [index.easysearch.mappings.espdf.properties.abstract.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "unknown setting [index.easysearch.mappings.espdf.properties.abstract.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
  },
  "status" : 400
}

我从旧实例获得的映射确实包含一些此类字段:

  "espdf" : {
    "properties" : {
      "abstract" : {
        "type" : "string"
      },
      "document" : {
        "type" : "attachment",
        "fields" : {
          "content" : {
            "type" : "string"
          },
          "author" : {
            "type" : "string"
          },
          "title" : {
            "type" : "string"
          },

这个“espdf”的东西可能来自 Meteor 的“EasySearch”组件,但我在映射中有更多这样的结构,新的 ES 拒绝它们中的每一个(我尝试编辑映射并删除“espdf”键和值) .

如何让新的 ES 接受映射?这是 2.x ES 的一些遗留问题吗?我应该以某种方式将其转换为新的 5.x ES 格式?

【问题讨论】:

    标签: json elasticsearch mapping


    【解决方案1】:

    失败的原因是旧版 ES 安装了一个名为 mapper-attachments 的插件,它会将 attachment 映射类型添加到 ES。

    在 ES 5 中,此插件已被 ingest-attachment 插件替换,您可以这样安装:

    bin/elasticsearch-plugin install ingest-attachment
    

    在您的 ES_HOME 文件夹中运行此命令后,重新启动您的 ES 集群,它应该会更好。

    【讨论】:

    • 这个运气好吗?
    猜你喜欢
    • 1970-01-01
    • 2023-01-04
    • 2021-02-04
    • 2016-07-23
    • 1970-01-01
    • 1970-01-01
    • 2021-08-11
    • 2013-09-10
    • 1970-01-01
    相关资源
    最近更新 更多