Add relations between nodes that have similar text attributes

Hello,

I have this situation:

  • a series of nodes that contains a property text with strings like:
    "California's change directly affects many of these companies, and more states are likely to soon follow"

  • then I have nodes for locations, thus I have one with id=California

I'd like to connect all nodes that contains "California" in their text with the node "California", but I am at a loss on how to handle the string search in Cypher...

Where should I look for pointers in the doc?

What about this one?

MATCH (n:Node)
WHERE n.text CONTAINS ’California’
MATCH (l:Location)
WHERE l.id = ’Californa’
MERGE (n)-[CONTAINS]->(l)
1 Like

Hi @simone

You can always adjust your string search according to your preferences with a regex base search. It's supported by Neo4J.

Bennu