We have a large network stored in v3.4.8 that incorporates nodes representing Companies and People. The edges between the nodes represent Appointments (i.e. Person 1 works at Company A).
Some of the People nodes are actually companies who function as if they are People (and are stored in the graph with a label of 'Is Company' = 1).
We are calculating the shortest path between companies using the built-in shortestPath cypher function -
match (start:Company {id:1}),(end:Company {id:100}), p = shortestPath((start)-[:APPOINTMENT*]-(end)) return *
What we want to do now is return the shortest path that doesn't involve a People node where 'Is Company' = 1.
I have tried using queries like where ALL(x in nodes(p) WHERE x.
Is Company = 0)
but performance is awful even with an index on 'Is Company'.