neo4j-contrib / neo4j-elasticsearch

Neo4j ElasticSearch Integration
Apache License 2.0
210 stars 79 forks source link

Support of Neo4j 4.0 #61

Open sim51 opened 4 years ago

sim51 commented 4 years ago

Following the PR #40 this the continuation with the support of Neo4j 4.0

yeus commented 4 years ago

hi, I have tested your plugin it builds without problems. But the plugin crashes when trying to use it with neo4j. I am not a java expert, so I hope I did everything correctly ;). Pretty much all I did was:

mvn package

and then take the jar file "file:///home/tom/Dropbox/company/comcharax/neo4j-elasticsearch/target/neo4j-elasticsearch-4.0.1-all.jar" and move it into the plugins directory

--> here is the pastebin of the log: https://pastebin.com/zePAMd5p

on startup it say this:

neo4j_1                   | 2020-06-14 11:23:52.647+0000 INFO  [graph.db] [graph.db] Creating ElasticSearchLifecycle
neo4j_1                   | 2020-06-14 11:23:52.648+0000 INFO  [graph.db] [graph.db] Starting ElasticSearchLifecycle
neo4j_1                   | 2020-06-14 11:23:52.649+0000 INFO  [graph.db] [graph.db] Stopping ElasticSearch lifecycle

hope this helps!

sim51 commented 4 years ago

Hi @yeus

Thanks for the info. Have you configured the index spec ? As an example : elasticsearch.neo4j.index_spec=people:Person(first_name,last_name), places:Place(name)

It seems that the NPE comes from that. I will modify the code to avoid this error.

yeus commented 4 years ago

Thanks,

summrizing I haven't tested which of all of the above things caused the actual error. I have to admit that the neo4j error log and also from the plugin are somewhat obscure to me ;).

sim51 commented 4 years ago

You can call the index mechanism with a cypher query, but the definition of the index must be in the neo4j configuration.

Moreover the neo4j (or in your case graph.db) is mandatory because Neo4j 4.X is multi-tenant, so you have to specify the database name.

For the HTTPS it's weird ...are you using a self signed certificate ?

sim51 commented 4 years ago

I have just done a tiny modification in the code to correct your issue, ie. when there is no plugin configuration the db doesn't start.

Zootje123 commented 2 years ago

Hi all,

I've been trying to get this to work with Neo4j 4.4.5 and ElasticSearch 8.1.2 but unfortunately no success. I am able to add the plugin and configurations to neo4j and neo4j is starting fine, but if I use for example: CALL elasticsearch.indexAll({ batchSize:500, async:false });

I do get the following error: Failed to invoke procedureelasticsearch.indexAll: Caused by: java.lang.Exception: Fail to perform bulk action : {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Action/metadata line [1] contains an unknown parameter [_type]"}],"type":"illegal_argument_exception","reason":"Action/metadata line [1] contains an unknown parameter [_type]"},"status":400}

I think this has something to do with the type mapping disabled in newer version of elasticsearch but not sure how to solve this.

Furthermore, I would like to know if indexing is also working for relationships?

Regards,

Tin-Nguyen commented 2 years ago

hi @Zootje123 were you able to resolve the issue? I'm using the same neo4j version and ElasticSearch. Wondering if I should use this plugin for indexing the neo4j data to ElasticSearch or find out another better one.

sim51 commented 2 years ago

FYI, you can take a look at this project which is more up to date https://gitlab.com/ouestware/neo4j-elasticsearch This PR has not been merge since a year, so I need to redo one with the new updated code, but I haven't found the time yet...

Tin-Nguyen commented 2 years ago

thanks @sim51