弹性搜索Lucene版本错误 [英] Elastic Search Lucene version error
问题描述
现在,当我在X中运行相同的代码,然后我得到这个错误并不知道如何解决。你能帮我一下吗
线程main中的异常java.lang.NoSuchFieldError:LUCENE_3_6
在org.elasticsearch.Version。< clinit>(Version.java:45)
在org.elasticsearch.node.internal.InternalNode。< init>(InternalNode.java:136)
在org.elasticsearch.node.NodeBuilder.build( NodeBuilder.java:159)
在org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
在org.bmi.elasticsearch.ranking.TestClass2.main(TestClass2.java:54)
似乎您正在尝试使用Elasticsearch和Lucene在您的项目中作为单独的库。
Elastissearch 1.4.1基于Lucene 4.10.2。您可以查看发布博客页面此处了解更多详情。
要解决您的问题,您将需要将Lucene库版本更新为4.10,并使用
Version.LUCENE_CURRENT而不是LUCENE_3_6。
您可以在这里找到 > Lucene 4.10 Core API文档。
我希望这将有所帮助。如果您有疑问,请随时给予评论。
I have a very simple ES Client which will send a query to local ES server(1.4.1 version of ES) and get the results and display to the user. Now, I took this code to a different project X and tried to use it along with X because I need some APIs from X. Now, when I run the same code when i am in X, then I get this error and don't know how to resolve. Can you please help me with this. Exception in thread "main" java.lang.NoSuchFieldError: LUCENE_3_6
at org.elasticsearch.Version.<clinit>(Version.java:45)
at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:136)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
at org.bmi.elasticsearch.ranking.TestClass2.main(TestClass2.java:54)
It seems that you are trying to use Elasticsearch and Lucene in your project as separate libraries.
Elastissearch 1.4.1 is based on Lucene 4.10.2. You can check the release blog page here for more details.
To solve your problem you will need to update your Lucene library version to 4.10 and use Version.LUCENE_CURRENT instead of LUCENE_3_6.
You can find here Lucene 4.10 Core API documentation.
I hope that this will help. Don't hesitate to comment if you have doubts.
这篇关于弹性搜索Lucene版本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!