From 8497dfc98e08d50f6f4a73fc2fc3077c85cfe98b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 15 Oct 2016 17:19:18 +0200 Subject: [PATCH] Fix follow suggestions order --- app/models/follow_suggestion.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/follow_suggestion.rb b/app/models/follow_suggestion.rb index e925461345..df1d77e6c3 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