Skip to content
Extraits de code Groupes Projets
Valider c913bdfc rédigé par Eugen Rochko's avatar Eugen Rochko
Parcourir les fichiers

Fix follow suggestion fallback to exclude already followed users

parent bfb6cc5f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -4,8 +4,7 @@ class FollowSuggestion ...@@ -4,8 +4,7 @@ class FollowSuggestion
neo = Neography::Rest.new neo = Neography::Rest.new
query = <<END query = <<END
START a=node:account_index(Account={id}) MATCH (a {account_id: {id}})-[:follows]->(b)-[:follows]->(c)
MATCH (a)-[:follows]->(b)-[:follows]->(c)
WHERE a <> c WHERE a <> c
AND NOT (a)-[:follows]->(c) AND NOT (a)-[:follows]->(c)
RETURN DISTINCT c.account_id, count(b), c.nodeRank RETURN DISTINCT c.account_id, count(b), c.nodeRank
...@@ -37,8 +36,11 @@ END ...@@ -37,8 +36,11 @@ END
neo = Neography::Rest.new neo = Neography::Rest.new
query = <<END query = <<END
OPTIONAL MATCH (a {account_id: {id}})
WITH a
MATCH (b) MATCH (b)
WHERE b.account_id <> {id} WHERE b <> a
AND NOT (a)-[:follows]->(b)
RETURN b.account_id RETURN b.account_id
ORDER BY b.nodeRank DESC ORDER BY b.nodeRank DESC
LIMIT {limit} LIMIT {limit}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter