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)
Lucene or Apache Lucene is an open-source Java library used as a search engine. Elasticsearch is built on top of Lucene. Elasticsearch converts Lucene into a distributed system/search engine for scaling horizontally.
Elasticsearch is also an open-source search engine built on top of Apache Lucene, as the rest of the ELK Stack, including Logstash and Kibana.
Lucene segments Each Elasticsearch index is divided into shards. Shards are both logical and physical divisions of an index. Each Elasticsearch shard is a Lucene index. The maximum number of documents you can have in a Lucene index is 2,147,483,519. The Lucene index is divided into smaller files called segments.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With