org.elasticsearch.ElasticSearchIllegalArgumentException: failed to find analyzer
Hi,
I am using elasticsearch 0.19.0 and installed ik analyzer as plugin: ./plugin -install medcl/elasticsearch-analysis-ik/1.0.0
My elasticsearch.yaml is like the following:
index: analysis: analyzer: ik: type: org.elasticsearch.index.analysis.IkAnalyzerProvider
Also I've downloaded the ik analyzer zip file and unzipped to %ESHOME%\config\ folder.
But when I issue the following command, the ElasticSearchIlegalArgumentException was thrown:
curl -XGET "localhost:9200/_analyze?analyzer=ik" -d "this is a test"
org.elasticsearch.ElasticSearchIllegalArgumentException: failed to find analyzer [ik] at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:147) at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:57) at org.elasticsearch.action.support.single.custom.TransportSingleCustomOperationAction$AsyncSingleAction$1.run(TransportSingleCustomOperationAction.java:143) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
Seems like the ES cannot find the ik analyzer.
What maybe the issue here?
Thanks.
1.after installed the plugin,you should restart the elasticsearch 2.you config is not correct,blank is needed,here is the one:
index:
analysis:
analyzer:
ik:
alias: [news_analyzer, news_analyzer_ik,ik_analyzer]
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
closed
The issue might be here. we should use this request with some specified index: curl -XGET 'localhost:9200/SOMEINDEX/_analyze?analyzer=ik&text=xxx'