[#477] User search tests. Normalized search rank in User.search.

This commit is contained in:
Ivan Tashkinov 2019-01-15 13:05:25 +03:00
commit 5b8f9ff8c1
2 changed files with 58 additions and 7 deletions

View file

@ -704,7 +704,8 @@ defmodule Pleroma.User do
ts_rank_cd(
setweight(to_tsvector('simple', regexp_replace(nickname, '\\W', ' ', 'g')), 'A') ||
setweight(to_tsvector('simple', regexp_replace(coalesce(name, ''), '\\W', ' ', 'g')), 'B'),
to_tsquery('simple', ?)
to_tsquery('simple', ?),
32
)
""",
^processed_query