我正在升级此插件:https://github.com/meltwater/elasticsearch-analysis-combo/tree/f3d4d365881416355e935afb966386a40325a53c 从ES 2.1.1到ES 2.2.0。我在插件中进行了必要的更改并安装了它。现在,当我在ES上运行任何请求时,它会为插件中的一个JAR中存在的类抛出 NoClassDefFoundError 。
我使用这些设置来创建索引:
{
"index" : {
"analysis" : {
"analyzer" : {
"default" : {
"type" : "custom",
"tokenizer" : "standard",
"filter" : [ "snowball", "lowercase" ]
},
"combo" : {
"type" : "combo",
"sub_analyzers" : [ "standard", "default" ]
}
},
"filter" : {
"snowball" : {
"type" : "snowball",
"language" : "english"
}
}
}
}
}
这是我发送的请求:
localhost:9200/testindex/_analyze?analyzer=combo&text=algorithm
这是回复:
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[Edward \"Ned\" Buckman][127.0.0.1:9300][indices:admin/analyze[s]]"
}
],
"type": "no_class_def_found_error",
"reason": "Could not initialize class org.apache.lucene.util.ReaderCloneFactory"
},
"status": 500
}
执行上述请求后的ES控制台日志:
RemoteTransportException[[Edward "Ned" Buckman][127.0.0.1:9300][indices:admin/analyze[s]]]; nested: NoClassDefFoundError[Could not initialize class org.apache.lucene.util.ReaderCloneFactory];
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.lucene.util.ReaderCloneFactory
at org.apache.lucene.analysis.ComboAnalyzer$CombiningTokenStreamComponents.createTokenStreams(ComboAnalyzer.java:204)
at org.apache.lucene.analysis.ComboAnalyzer$CombiningTokenStreamComponents.getTokenStream(ComboAnalyzer.java:195)
at org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:182)
at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.simpleAnalyze(TransportAnalyzeAction.java:240)
at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:225)
at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:63)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$ShardTransportHandler.messageReceived(TransportSingleShardAction.java:282)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$ShardTransportHandler.messageReceived(TransportSingleShardAction.java:275)
at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:350)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
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)