From: Ivan Tashkinov Date: Wed, 16 Jan 2019 07:44:32 +0000 (+0300) Subject: [#477] Minor refactoring (user search query). X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=0bc6d30f7dfe53be588329e48f1255b5eef18a2a;p=akkoma [#477] Minor refactoring (user search query). --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 2488697bb..8ae36416a 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -702,12 +702,14 @@ defmodule Pleroma.User do fragment( """ ts_rank_cd( - setweight(to_tsvector('simple', regexp_replace(nickname, '\\W', ' ', 'g')), 'A') || - setweight(to_tsvector('simple', regexp_replace(coalesce(name, ''), '\\W', ' ', 'g')), 'B'), + setweight(to_tsvector('simple', regexp_replace(?, '\\W', ' ', 'g')), 'A') || + setweight(to_tsvector('simple', regexp_replace(coalesce(?, ''), '\\W', ' ', 'g')), 'B'), to_tsquery('simple', ?), 32 ) """, + u.nickname, + u.name, ^processed_query ) },