"reason":"No handler for type [attachment] declared on field [file]" 最完全解决方案
0、elasticsearch-mapper-attachments 2.3.4安装
mapper-attachments安装方法分两类,在线和离线:
- 在线安装
bin/elasticsearch-plugin install mapper-attachments
- 离线安装
bin/elasticsearch-plugin install file:///path/to/mapper-attachments-2.3.4.zip
插件下载地址见:ES插件elasticsearch-mapper-attachments 2.3.4及各个版本正确下载地址
1、插入attachment mapping时,报错
报错详情:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"No handler for type [attachment] declared on field [file]"}],
"type":"mapper_parsing_exception","reason":"No handler for type [attachment] declared on field [file]"},"
status":400}
具体引起报错的指令:
curl -XPUT http://88.88.88.88:9200/test/person/_mapping -d '{
"person": {
"properties": {
"file": {
"type": "attachment",
"path": "full",
"fields": {
"file": {
"type": "string",
"term_vector":"with_positions_offsets",
"store": true
}}}}}}'
可以看到中间的attachment类别无法识别。
那么最完全解决方案是我总结如下:
- 是否重启ES
大部分插件在重启后,ES才会在初始化过程中加载plugins。
- 查看重启日志,查看是否存在mapper-attachments关键词
[node-es-xxxx-pub03] modules [reindex, lang-expression, lang-groovy], plugins [elasticsearch-analysis-ansj, mapper-attachments, kopf, analysis-ik], sites [elasticsearch-analysis-ansj, kopf]
可以看到,该插件是正常加载的。
- curl查看节点plugins信息,查看插件是否安装正确
[xxxx@hostname estest]$ curl -XGET 88.88.88.88:/_cat/plugins?v
name component version type url
node-es-xxx-pub01 analysis-ik 1.9. j
node-es-xxx-pub01 gui 2.0. s /_plugin/gui/
node-es-xxx-pub01 kopf 2.0. s /_plugin/kopf/
node-es-xxx-pub01 mapper-attachments 2.3. j
……
……
可以看到,我们的插件是安装正确的。
- 是否是集群?集群需要集群重启(还有一种可能是master节点必须重启)
集群所有节点都重启有可能不需要,时间紧张我也没时间去测了,反正我都重启了一遍。
这里我觉得只需要对master节点重启。因为如果调用es集群中的slave节点的es服务,对应它也会转到master节点来处理任务,毕竟只有master节点的log在刷新。
----------------------------------------------------------------------
至此,问题解决,重启了集群
"reason":"No handler for type [attachment] declared on field [file]" 最完全解决方案的更多相关文章
- No handler for type [text] declared on field [content]
Install 1.compile checkout ik version respective to your elasticsearch version git checkout tags/{ve ...
- [神经网络与深度学习][计算机视觉]SSD编译时遇到了json_parser_read.hpp:257:264: error: ‘type name’ declared as function ret
运行make之后出现如下错误: /usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: 'type n ...
- 【Junit】The import org.junit.Test conflicts with a type defined in the same file报错
引入Junit后,进行单元测试,莫名其妙报了个这样的错误 The import org.junit.Test conflicts with a type defined in the same fil ...
- AIDL interface XXX should be declared in a file
在写AIDL的时候出现了interface XXX should be declared in a file, 错误...经过反复查看,发现AIDL规定,文件名必须和interface XXX名字相同 ...
- react.js Warning: Failed form propType: You provided a value prop to a form field without an onChange handler. This will render a read-only field.
错误信息: eact.js:20483 Warning: Failed form propType: You provided a value prop to a form field without ...
- 手机端input[type=date]的时候placeholder不起作用解决方案
目前PC端对input 的date类型支持不好,我试下来的结果是只有chrome支持.firefox.IE11 都不支持.而且PC端有很多日历控件可供使用.就不去多考虑这点了. 那么在移动端的话,io ...
- 利用传入的Type类型来调用范型方法的解决方案
起因:自定义一个GridView控件,其数据源来源于一个通用方法Get<T>(),根据你传入的T到数据库中得到相应的数据,问题是定义GridView控件时没法在界面端设置使用泛型,只能在每 ...
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...
- 怎么在eclipse中查到这个类用的是哪个jar的类和Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
找到了一个办法,你先按F3,然后点击Change Attached Source..按钮,在弹出的框里有个路径,我的路径是D:/SNFWorkSpace/JAR/~importu9.jar,然后你去引 ...
随机推荐
- Java之字节码(1) - 深入解析
转载地址 一:Java字节代码的组织形式 类文件{ OxCAFEBABE,小版本号,大版本号,常量池大小,常量池数组,访问控制标记,当前类信息,父类信息,实现的接口个数,实现的接口信息数组,域个数,域 ...
- CompletableFuture 详解
转 http://www.jianshu.com/p/6f3ee90ab7d3 CompletableFuture类实现了CompletionStage和Future接口.Future是Java 5添 ...
- Google C++ Coding Style 学习笔记
写在前面:最新公司马上就要开始开发一款视觉产品,工程量较大,且需要对客户提供可以二次开 发的SDK,整个项目用C++编写. 这就对代码质量提出了非常高的要求,同时,如何设计出优雅稳定的API也是相当大 ...
- Linux下将/TMP和/Var移动到共享分区
2007-03-09 03:25:08 整理数据 首先,必须创建一个新分区专门用于存储频繁修改的文件.您可能希望将这个分区置于单独的磁盘上以增强性能.接下来,我将逐步说明将 /tmp 和 /va ...
- JAVA中的抽象类与接口
抽象类 abstract class 包含抽象方法的类,叫抽象类.而抽象的概念就是抽象出共同属性:成员变量和方法.所以抽象类可以有private等多种权限的成员变量和非abstract的成员方法.当然 ...
- Python --标准库 存储对象 (pickle包,cPickle包)
在之前对Python对象的介绍中 (面向对象的基本概念,面向对象的进一步拓展),我提到过Python“一切皆对象”的哲学,在Python中,无论是变量还是函数,都是一个对象.当Python运行时,对象 ...
- XML相关转换
1.将DataTable转换成xml字符串 //将DataTable转换成xml字符串: public string ConvertDataTableToXml(DataTable dt) { Mem ...
- NAT Network Address Translation,网络地址转换
Network Address Translation,网络地址转换
- nodejs http代理请求
一些免费到代理地址 http://www.xicidaili.com/nn https://proxy.l337.tech/txt http://www.66ip.cn/nm.html 以下代码可以测 ...
- Javascript中的对象和原型(一)(转载)
面向对象的语言(如Java)中有类的概念,而通过类可以创建任意多个具有相同属性和方法的对象.但是,JavaScript 没有类的概念,因此它的对象也与基于类的语言中的对象有所不同. 要了解面向对象,首 ...