Hi. We are facing issues while upgrading Neo4j from 3.1 to 3.3 due to incompatible Lucene versions used by Neo4j and ElasticSearch. We are using Rest based client provided by ES to query data.
Please find the maven dependencies used for neo4j and elastic search rest client
The lucene version used by Neo4j is 5.5.0 but the one required by ElasticSearch is 6.6.1.
When 5.5.0 version of Lucene is used, we are facing the following issue at runtime:
Caused by: java.lang.NoSuchFieldError: LUCENE_5_5_2 at org.elasticsearch.Version.<clinit>(Version.java:75) at org.elasticsearch.common.logging.DeprecationLogger.<clinit>(DeprecationLogger.java:159) at org.elasticsearch.common.ParseField.<clinit>(ParseField.java:35) at org.elasticsearch.client.RestHighLevelClient.lambda$getDefaultNamedXContents$47(RestHighLevelClient.java:673) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
We have also tried using the version 6.6.1, in which case the neo4j cypher queries are failing to get executed.
We are using one of the latest stable releases of elastic search Rest client. We have also tried shading approach but to no avail. Please provide suggestions as to how to resolve this issue.
Unfortunately, as you said, I was unable to shade Lucene. It was causing a lot of conflicting dependency issues.
Do we have a pure Java REST API for querying ElasticSearch without lucene dependencies?
1.Going through the ES documentation, I understood that Native Java Client is gonna be deprecated in ES 7.0.
2.The lucene dependencies brought in by ElasticSearch High Level Client(6.x) is incompatible with Neo4j.
3.And it seems JEST is not yet upgraded to support ES 6.x.
Is there any other pure Java REST API Library that can talk to ES without any lucene dependencies?
You can use the low level client which comes with very few deps.
But there is no fancy API exposed there. Just basic HTTP calls.
That's the situation for now. Things are going to evolve and hopefully in the future it won't be an issue anymore but this work will take a lot of time/work IMO.
Thanks for your suggestion. Using Rest Low level client resolved the issue since it had no lucene dependencies.
Need one quick suggestion on how to use the Bulk API in low level REST client. Currently I am using the Bulk API to post data for a single type and index.So if I have 10 types for the same index, I need to invoke the bulk API 10 times.
Is it possible to post data for multiple types but the same index using a single invocation of the bulk API. Have gone through the following documentation for the bulk API:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.