elasticsearch - 映射附件在 Elasticsearch 7.7 中引发错误
问题描述
我尝试将该字段映射为用户定义的字段 - 弹性搜索中的“附件”,如下所示
"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] 的处理程序]
我已经将摄取附件插件添加到弹性搜索插件中,当我在弹性搜索中列出插件时它可用。
我的映射有什么问题?
请帮我解决这个问题?
谢谢,
哈利
解决方案
您已经安装了该插件,并且在您列出它时可用。但是你得到了错误No handler for type [attachment] declared on field [file]
原因:
您期望添加attachment
为一种类型。但事实并非如此。
摄取附件插件不添加新类型。但增加了一个摄取处理器
您需要将其添加为管道中的处理器。
更新1:
仅安装插件并不能解决问题,因为它是无效类型。我能够重现此错误。
参考文档是上面的链接是我在原始答案中附加的链接。
推荐阅读
- java - JDK11 HttpClient 是否支持尾部标头?
- mysql - 按嵌套表计数排序
- python - Jupyter 笔记本无法与 Pycharm 一起使用
- mysql - PHP 错误,未定义的偏移量:Codeigniter 中的 0
- swift - 更改 NSAttributedString 的颜色并在 safari 中打开其链接
- python-3.x - 抽象类,重复继承,具体例子
- python - 如何为 Google Sheets API v4 正确构建服务对象
- python-3.x - 运算输入和计算的输入梯度之间的形状不兼容。conv2d_transpose 知道如何解决吗?
- angular - 获取父级的所有后代组件,即使通过路由器插座呈现
- c# - Blazor WebAssembly 中附带了不必要的 dll