5.4. Find people based on similar favorites

5.4.1. Find people based on similar favorites

Graph

cypher-peoplesimilarityfavorites-graph.svg

5.4.1. Find people based on similar favorites

To find out the possible new friends based on them liking similar things as the asking person:

Query

START me=node:node_auto_index(name = "Joe")
MATCH me-[:favorite]->stuff<-[:favorite]-person
WHERE NOT(me-[:friend]-person)
RETURN person.name, count(stuff)
ORDER BY count(stuff) DESC

The list of possible friends ranked by them liking similar stuff that are not yet friends.

Result

person.namecount(stuff)
2 rows, 1 ms

"Derrick"

2

"Jill"

1