title: Remove a relationship from index with APOC Neo4J 3.x
body: <p>when I remove a relationship in Neo4J 3.x I want it also to be removed from the automatic index created using APOC.</p>
  
  <p>However, I don't see any procedure to remove a relationship in APOC. I only see <code>removeRelationshipByName</code> but then I have to specify the Name of the relationship and what if I had the relationships by type? If the relationship is not deleted, I get an error when I try to search using this index by relationship property. It finds a relationship in the index but it doesn't exist.</p>
  
  <p>Just to get a better idea, I created the index on existing relationships using </p>
  
  <p><code>MATCH ()-[r]-&gt;() CALL apoc.index.addRelationship(r,['user','context','statement','gapscan']) RETURN count(*);</code></p>
  
  <p>This creates several indexes for several relationship types.</p>
  
  <p>I also set up a trigger so that every time a relationship is added (no matter what type) it is added to the index of the appropriate type </p>
  
  <p><code>CALL apoc.trigger.add('RELATIONSHIP_INDEX',"UNWIND {createdRelationships} AS r MATCH ()-[r]-&gt;() CALL apoc.index.addRelationship(r,['user','context','statement','gapscan']) RETURN count(*)", {phase:'after'})</code></p>
  
  <p>Now, what I want to do is to set up a trigger that would remove the relationships from the index when they are removed. But there's no procedure <code>removeRelationship</code> — only <code>removeRelationshipByName</code> — however, I don't understand how to use it in that context. What name should I provide? </p>