Open sim51 opened 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!
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.
Thanks,
yes, I have included them but I am realizing that I used the "old" way of doing this using neo4j 3.5
which was without the .neo4j.
in the configuration parameters. I assumed though that they were
optional, as you can also do the indexing through a cypher call? My options now look like this: I am using docker and added them as environment variables inside the dockerfile which seems to work fine:
ENV NEO4J_dbms_security_procedures_unrestricted=elasticsearch.* \
NEO4J_elasticsearch_neo4j_index__spec="people:Person(name), movies:Movie(title)" \
NEO4J_elasticsearch_neo4j_host__name=http://elastic:9200
Additionally, as I upgraded my DB from 3.5, the default database was named "graph.db" and not "neo4j". Once I corrected these things and also downgraded from 4.0.4 to 4.0.1 it worked. I haven't tried yet whether the plugin works with 4.0.4 with all the other things from above in place.
Additionally, I had to turn off https aces to elastic search for the plugin to work.
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 ;).
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 ?
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.
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 procedure
elasticsearch.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,
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.
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...
thanks @sim51
Following the PR #40 this the continuation with the support of Neo4j 4.0