aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-11-04 16:57:41 +0100
committerlain <lain@soykaf.club>2019-11-04 16:57:41 +0100
commit4e535209172bb5460353fe011c06d127cfaa5847 (patch)
treeae44b0cbde3bc5d027c26c31127f69a0e2f2a4cd /lib
parenta304a2a845834b73636706ba82e34463a47d9258 (diff)
downloadpleroma-4e535209172bb5460353fe011c06d127cfaa5847.tar.gz
User Search: Remove superfluous setweight and random test.
The test tested for a behavior that isn't actually enforced anymore.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user/search.ex12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/pleroma/user/search.ex b/lib/pleroma/user/search.ex
index bab8d92e2..09664db76 100644
--- a/lib/pleroma/user/search.ex
+++ b/lib/pleroma/user/search.ex
@@ -54,15 +54,7 @@ defmodule Pleroma.User.Search do
|> maybe_restrict_local(for_user)
end
- @nickname_regex ~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~\-@]+$/
defp fts_search(query, query_string) do
- {nickname_weight, name_weight} =
- if String.match?(query_string, @nickname_regex) do
- {"A", "B"}
- else
- {"B", "A"}
- end
-
query_string = to_tsquery(query_string)
from(
@@ -70,12 +62,10 @@ defmodule Pleroma.User.Search do
where:
fragment(
"""
- (setweight(to_tsvector('simple', ?), ?) || setweight(to_tsvector('simple', ?), ?)) @@ to_tsquery('simple', ?)
+ (to_tsvector('simple', ?) || to_tsvector('simple', ?)) @@ to_tsquery('simple', ?)
""",
u.name,
- ^name_weight,
u.nickname,
- ^nickname_weight,
^query_string
)
)