about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-15 17:19:18 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-15 17:19:18 +0200
commit6e0b3ddb0d14aaf7ea86efad8053966208c73b2c (patch)
tree3589413b7ad0b95aeb36a1d93f0a7f75437c7e2e /app
parentdf2c0b8dad40c8f8bcf7a201a0f2827e97bf506b (diff)
Fix follow suggestions order
Diffstat (limited to 'app')
-rw-r--r--app/models/follow_suggestion.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/follow_suggestion.rb b/app/models/follow_suggestion.rb
index e92546134..df1d77e6c 100644
--- a/app/models/follow_suggestion.rb
+++ b/app/models/follow_suggestion.rb
@@ -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