Hello,
I have found a way to get a similiar result (it contains the starting nodes) but a much faster query time:
START r=node(1), a = node(3590), b = node(3588), c = node(3591), d=node(3613) MATCH r--re-[:CONTAINS]-i WHERE (re-[:CONTAINS]-a and re-[:CONTAINS]-b and re-[:CONTAINS]-c) and (not(re-[:CONTAINS]-d)) return distinct id(i), i.title, count(r) as count order by count desc limit 10;
This now runs in about 200ms. And it has the nice side effect that it gets faster as I add more constrains.
But is there a way to denote the nodes that I want to match as an array or something like that? I have tried
START r=node(1), a = node(3590, 3588, 3591), d=node(3613) MATCH r--re-[:CONTAINS]-i WHERE (ALL(x in a WHERE re-[:CONTAINS]-x)) and (not(re-[:CONTAINS]-d)) return distinct id(i), i.title, count(r) as count order by count desc limit 10;
but it just raises: "SyntaxException: Unknown identifier `a`"
Also, is there any way to remove the start nodes from the result?
Cheers,
Paul