neo4j-contrib / neo4j-elasticsearch

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

Neo4J commit fails when a Null property is found #31

Open obenard opened 7 years ago

obenard commented 7 years ago

Hello, Let's say I have a index spec like: elasticsearch.index_spec=neo_index_name:Application(name,description)

If one of my Application Nodes has a NULL description, any attempts to commit a change on this Application node will fail with the following error: For example MATCH (a:Application) WHERE a.description IS NULL SET a.name = "foobar" "errors": [ { "code": "Neo.DatabaseError.Transaction.CouldNotCommit", "message": "org.neo4j.kernel.api.exceptions.TransactionFailureException: ", "stackTrace": "java.lang.RuntimeException: … n\t... 41 more\nCaused by: org.neo4j.graphdb.NotFoundException: NODE[24573] has no property with propertyKey=\"name\".\n\tat org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:482)\n\tat org.neo4j.elasticsearch.ElasticSearchEventHandler.nodeToJson(ElasticSearchEventHandler.java:186)\n\tat org.neo4j.elasticsearch.ElasticSearchEventHandler.indexRequests(ElasticSearchEventHandler.java:114)\n\tat org.neo4j.elasticsearch.ElasticSearchEventHandler.beforeCommit(ElasticSearchEventHandler.java:61)\n\tat org.neo4j.elasticsearch.ElasticSearchEventHandler.beforeCommit(ElasticSearchEventHandler.java:27)\n\tat org.neo4j.kernel.TransactionEventHandlers.beforeCommit(TransactionEventHandlers.java:130)\n\tat org.neo4j.kernel.TransactionEventHandlers.beforeCommit(TransactionEventHandlers.java:49)\n\t... 43 more\nCaused by: org.neo4j.kernel.api.exceptions.PropertyNotFoundException: NODE[24573] has no property … } ]

This is drastically changing the behavior of Neo4J (because without the plugin, this request would succeed), so I would have rather expected that the injection to elastic search was ignored without affecting the commit of the data in Neo4J.

Is there any quick fix possible to commit and ignore the injection in Elastic Search?

Note this is with Neo4J 2.3

Thanks for your help Regards