diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-11-06 06:16:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-06 06:16:34 +0100 |
commit | 3151b260e27c1d3143b36a68b700bf3884ae9808 (patch) | |
tree | ece9754559dc8aac12aae3c02d1105447855a1db /app | |
parent | 58fc889c6fe697da4f880cb43e75d97d3a604d79 (diff) |
Fix not using GIN index for account search queries (#19830)
Diffstat (limited to 'app')
-rw-r--r-- | app/models/account.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index da0ee2336..3647b8225 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -445,7 +445,7 @@ class Account < ApplicationRecord class << self DISALLOWED_TSQUERY_CHARACTERS = /['?\\:‘’]/.freeze - TEXTSEARCH = "(setweight(to_tsvector('simple', accounts.display_name), 'A') || setweight(to_tsvector('simple', accounts.username), 'A') || setweight(to_tsvector('simple', coalesce(accounts.domain, '')), 'C'))" + TEXTSEARCH = "(setweight(to_tsvector('simple', accounts.display_name), 'A') || setweight(to_tsvector('simple', accounts.username), 'B') || setweight(to_tsvector('simple', coalesce(accounts.domain, '')), 'C'))" REPUTATION_SCORE_FUNCTION = '(greatest(0, coalesce(s.followers_count, 0)) / (greatest(0, coalesce(s.following_count, 0)) + 1.0))' FOLLOWERS_SCORE_FUNCTION = 'log(greatest(0, coalesce(s.followers_count, 0)) + 2)' |