blob: d5e71e63e240f31c1602c8d379620c74f2244a4a [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001for $user in dataset('Users')
2let $similar_users :=
3 for $similar_user in dataset('Users')
4 let $similarity := jaccard_similarity($user.interests, $similar_user.interests)
5 where $user != $similar_user
6 and $similarity >= .75
7 order by $similarity desc
8 limit 10
9 return { "user_name" : $similar_user.name, "similarity" : $similarity }
10return { "user_name" : $user.name, "similar_users" : $similar_users }