projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b8f9ff
)
[#477] Minor refactoring (user search query).
author
Ivan Tashkinov
<ivantashkinov@gmail.com>
Wed, 16 Jan 2019 07:44:32 +0000
(10:44 +0300)
committer
Ivan Tashkinov
<ivantashkinov@gmail.com>
Wed, 16 Jan 2019 07:44:32 +0000
(10:44 +0300)
lib/pleroma/user.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index 2488697bb3bf217d362903ff022f3beab392850f..8ae36416a761fb388e0beebef76cbaf2dcdc359f 100644
(file)
--- 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
)
},