Elastic Search Lucene version error

12,925

Solution 1

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.

Solution 2

Same error can occur in another case also - if someone unpack new ElasticSearch version in the same directory as previous version. Then it ends up with two versions of the jars in 'ElasticSearch/lib' directory. The error appears on startup.

In this case, the fix is to make clean ElasticSearch installation, without leftovers.

Share:
12,925

Related videos on Youtube

Vineel
Author by

Vineel

Interested in designing, building and shipping software/products to make impact and create amazing user experiences. Particularly focusing on cloud and applied Machine Learning.

Updated on September 19, 2022

Comments

  • Vineel
    Vineel over 1 year

    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)