Error while using Elase Search Lucene

I have a very simple ES client that will send a request to the local ES server (version 1.4.1 ES) and get the results and display the user. Now I have applied this code to another project X and tried to use it together with X because I need some APIs from X. Now when I run the same code when I am in X I get this error and I donโ€™t know how solve it. Could you please help me with this. Exception on 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)

      

+3


source to share


2 answers


You seem to be trying to use Elasticsearch and Lucene as separate libraries in your project.

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 need to update your Lucene library version to 4.10 and use Version.LUCENE_CURRENT instead of LUCENE_3_6.



You can find the Lucene 4.10 Core API Documentation here.

I hope this helps. Feel free to comment if in doubt.

+12


source


The same error can occur in another case as well - if someone unpacks a new version of ElasticSearch in the same directory as the previous version. It then ends with two versions of banners in the "ElasticSearch / lib" directory . Startup error.



In this case, the fix is โ€‹โ€‹to do a clean install of ElasticSearch with no leftovers.

+2


source







All Articles