]> cat aescling's git repositories - mastodon.git/commitdiff
Fix follow suggestions order
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 15 Oct 2016 15:19:18 +0000 (17:19 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 15 Oct 2016 15:19:18 +0000 (17:19 +0200)
app/models/follow_suggestion.rb

index e925461345d4f1d5b33584284ad7f80329600c10..df1d77e6c31b500f73c4c4df62ec364f467da950 100644 (file)
@@ -7,8 +7,8 @@ START a=node:account_index(Account={id})
 MATCH (a)-[:follows]->(b)-[:follows]->(c)
 WHERE a <> c
 AND NOT (a)-[:follows]->(c)
-RETURN DISTINCT c.account_id, c.nodeRank
-ORDER BY c.nodeRank
+RETURN DISTINCT c.account_id, count(b), c.nodeRank
+ORDER BY count(b) DESC, c.nodeRank DESC
 LIMIT {limit}
 END