ElasticSearch and Neo4j Java client in same Project

We have been trying to derive Elastic Search query from a Neo4j graph. i.e. Elastic Search java client and Neo4j java client both exist in the same project. However, both are not running simulatneously.

This is possibly due to multiple lucene jar version used by both the framework. But my requirement is to have both the client libraries in the same project.

Neo4j version : 3.1 Elastic Search version : 5.2

Is there any way by which both java client libraries for Elastic and Neo4j co exist in same project.

P.S. I am not trying to modify the graph. I looked into Neo4j elasticsearch plugin but it only pushes the changes to elastic search. In my case, the graph will be pre built so no changes as such will be happening in real time.


Elasticsearch has to run with the lucene version it depends on - I assume the same for neo4j, but I dont know. You need to split projects or have separate class loaders if they cannot co-exist together, there is no way around it.


Yes. ES is using latest version of Lucene. However Neo4j is still using Lucene 3.X and it is a required dependency to run the Neo4J.

Can you guide me on how to use separate class loaders for them. I have to ensure they co exist inside the same project.

THis is also logical, as for using both Neo4j and Elastic I cannot have two projects and two binaries being deployed.


class loaders are a very complex beast and not really in the scope of a single technical answer. I think you will have a very hard time with both neo4j/elasticsearch in the same project and should probably think of splitting them and find some other inter project communication (RPC, HTTP, you-name-it).


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.