Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
0bc6d30f
Commit
0bc6d30f
authored
Jan 16, 2019
by
Ivan Tashkinov
Browse files
[#477] Minor refactoring (user search query).
parent
5b8f9ff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
0bc6d30f
...
...
@@ -702,12 +702,14 @@ def search(query, resolve \\ false, for_user \\ nil) 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
)
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment