private bool RelationshipExistsByQuery(RelationshipIndex index, Node startNode, Node endNode, bool specifyStartNode) { bool found = false; using (Transaction tx = Db.beginTx(), IndexHits <Relationship> query = index.Query("key", QueryContext.numericRange("key", 0, 3), specifyStartNode ? startNode : null, null)) { foreach (Relationship relationship in query) { if (relationship.StartNodeId == startNode.Id && relationship.EndNodeId == endNode.Id) { found = true; break; } } tx.Success(); } return(found); }
public override IndexHits <Relationship> Query(string key, object queryOrQueryObjectOrNull, Node startNodeOrNull, Node endNodeOrNull) { return(@delegate.Query(key, queryOrQueryObjectOrNull, startNodeOrNull, endNodeOrNull)); }