Elastic Search Lucene 版本错误 [英] Elastic Search Lucene version error

查看:50
本文介绍了Elastic Search Lucene 版本错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的 ES 客户端,它将向本地 ES 服务器(ES 的 1.4.1 版本)发送查询并获取结果并显示给用户.现在,我将此代码带到另一个项目 X 并尝试将其与 X 一起使用,因为我需要一些来自 X 的 API.现在,当我在 X 中运行相同的代码时,我收到此错误并且不知道如何解决.你能帮我解决这个问题吗?线程main"中的异常 java.lang.NoSuchFieldError: LUCENE_3_6

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)

推荐答案

您似乎试图在您的项目中将 Elasticsearch 和 Lucene 作为单独的库使用.

It seems that you are trying to use Elasticsearch and Lucene in your project as separate libraries.

Elastissearch 1.4.1 基于 Lucene 4.10.2.您可以查看发布博客页面此处了解更多详情.

Elastissearch 1.4.1 is based on Lucene 4.10.2. You can check the release blog page here for more details.

要解决您的问题,您需要将 Lucene 库版本更新到 4.10 并使用Version.LUCENE_CURRENT 而不是 LUCENE_3_6.

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.

您可以在此处找到 Lucene 4.10 核心 API 文档.

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.

这篇关于Elastic Search Lucene 版本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆