In Neo4j, if I delete an indexed node do I have to remove that node from the index first or will the index be updated automatically?
Here is a small (untested) example:
val index = graphDb.index()
val someIdx = index.forNodes("someIdx")
val someNode = graphDb.createNode()
someIdx.add(someNode, "key", "value")
And then:
//remove from someIdx???
someNode.delete()
When you delete a node, you have to remove the index first. If you want to remove all mentions of a node from the index, see below:
IndexManager indexManager = db.index();
Index<Node> index = indexManager.forNodes("indexName");
index.remove(node);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With