在使用elasticsearch-rtf 2.2.0版本时使用analyze命令测试配置的自定义分词器是否生效,结果运行后日志报错,我测试的url命令如下:
http://10.0.18.123:9200/_analyze?text=中文测试&analyzer=ik_syno
[ERROR][transport ] [Cassiopea] failed to handle exception for action [indices:admin/analyze[s]], handler [org.elasticsearch.action.support.single.shard.TransportSingleShar[email protected] ]
java.lang.NullPointerException
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:195)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.access$700(TransportSingleShardAction.java:115)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$1.handleException(TransportSingleShardAction.java:174)
at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:821)
at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:799)
at org.elasticsearch.transport.TransportService$4.onFailure(TransportService.java:361)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
查询google得知为最新的bug一枚,https://github.com/elastic/elasticsearch/pull/15447 ,做个记号。测试的时候需要在设置的索引上运行analyze来避免这个bug被触发。
http://10.0.18.123:9200/indexName/_analyze?text=中文测试&analyzer=ik_syno