Reputation: 8423
I created auto relationship index as described on Neo4J website and when I get a list of the current relationship indexes using
curl -i http://localhost:7474/db/data/index/auto/relationship/status
I get TRUE
Then when I list the properties of relationships indexed using
curl -i http://localhost:7474/db/data/index/auto/relationship/properties
I get a list, which is correct:
[ "statement", "context", "gapscan", "user" ]
(these are the properties of my relationship)
Finally, and that's what doesn't work - when I try to see all the relationships where the property gapscan (key=2 as above) equals '4' using
curl -i http://localhost:7474/db/data/index/relationship/relationship_auto_index/gapscan/4
I don't get any results – it's empty.
Does anyone know why this doesn't work? Isn't GET request to the link above supposed to show me all the relationships matching?
UPDATE:
Turned out I was using the wrong {key} in the URL, but the problem still persists for the old relationships that were in the system before I added auto index. How do I index them?
Upvotes: 1
Views: 1224
Reputation: 8423
Asking a question is the best way to solve it... Turned out that the way to do it is to run the following query on every relationship property:
START rel=relationship(*)
WHERE has(rel.gapscan)
WITH rel
SET rel.gapscan = rel.gapscan
RETURN count(rel);
(as shown here for nodes)
Upvotes: 2