I'm using Neo4j 2.2.0. I have two csv files. The first csv is a distinct list of all nodes, e.g. Friend nodes. The second csv is a list of the relationships between friends. I'm using the browser to load the data and create relationships. However when creating the relationships its creating new nodes for the Friends instead of using existing nodes.
Cypher for loading friends-
USING PERIODIC COMMIT 10000
LOAD CSV WITH HEADERS FROM "http://localhost/csv/Friends.csv" AS row
CREATE (:Friends {Friend_Name: row.Friend_Name});
Cypher for loading relationships-
USING PERIODIC COMMIT 10000
LOAD CSV WITH HEADERS FROM "http://localhost/csv/Relationships.csv" AS row
MATCH (Friend1:Friends {Friend_Name: row.Friend_Name})
MATCH (Friend2:Relationships {Friend_Name: row.Friend_Name})
CREATE (Friend1)-[:Friend_With]->(Friend2);
Please can someone point me in the right direction.