0
votes

I created some nodes (n) with labels:

(n:Label1)

I then later merged new information to these nodes, at which point I also assigned a new label:

MERGE...
ON MATCH SET n:Label2

This results in nodes which have both Label1 and Label2.

However...when I search for nodes using Label2, I get 0 results. When I search for nodes using:

MATCH (n:Label1:Label2) RETURN n

Then I do get results... I was under the impression that labels could be used independently of each other for various matching procedures? Is this not the case? Or is there some kind of Label index that has not yet caught up yet and therefore not working with queries?

1

1 Answers

3
votes

Just tried on 2.1.2, couln't verify a problem here:

create (n:Label1:Label2) return n  // returns one node with id 0

match (n) where id(n)=0 return labels(n) // returns Label1, Label2

// all three statements return node 0
match (n:Label1:Label2) return n
match (n:Label1) return n
match (n:Label2) return n

This is the expected behaviour. Maybe you're on a older version?