【问题标题】:Mapping attachment is throwing the error in Elasticsearch 7.7映射附件在 Elasticsearch 7.7 中引发错误
【发布时间】:2020-10-12 08:33:16
【问题描述】:

我尝试将该字段映射为用户定义的字段 - 弹性搜索中的“附件”,如下所示

"file": {
            "type": "attachment",
            "fields": {
              "content": {
                "type": "text"
              },
              "author": {
                "type": "text",
                "store": true
              }
}

附件映射如下,

"attachment": {
            "properties": {
              "author": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "content": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }

但我收到以下错误:

java.util.concurrent.ExecutionException: RemoteTransportException[[3cfb4e163654][172.17.0.2:9300][indices:admin/create]]; nested: MapperParsingException[Failed to parse mapping [mappings]: No handler for type [attachment] declared on field [file]]; nested: MapperParsingException[No handler for type [attachment] declared on field [file]];

[无法解析映射 [mappings]:没有在字段 [file] 上声明的类型 [attachment] 的处理程序]

我已经将摄取附件插件添加到弹性搜索插件中,当我在弹性搜索中列出该插件时它可用。

我的映射有什么问题?

请帮我解决这个问题?

谢谢,
哈利

【问题讨论】:

  • 能否分享整个mapping.json,让我自己试试
  • 是的,mapping 是部分的。 @harry 在attachment 中添加file 的映射
  • @OpsterElasticsearchNinja codeshare.io/5gYjjB我已经分享了完整的json
  • @Gibbs codeshare.io/5gYjjB我已经分享了json,请告诉我我需要做的修改

标签: elasticsearch elasticsearch-plugin elasticsearch-7


【解决方案1】:

您已经安装了该插件,并且在您列出它时可用。但是你得到了错误No handler for type [attachment] declared on field [file]

原因:

您希望将attachment 添加为类型。但事实并非如此。

摄取附件插件不添加新类型。 但增加了一个摄取处理器

Reference

您需要将此作为处理器添加到您的管道中。

更新1:

只安装插件并不能解决问题,因为它是无效类型。我能够重现此错误。

Reference 文档是上面的链接,是我在原始答案中附加的链接。

Nice explanation about the way of usage

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-01
  • 2018-03-30
  • 1970-01-01
  • 2017-03-11
  • 2017-04-11
  • 1970-01-01
相关资源
最近更新 更多