projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b108aee
)
Set custom similarity limit.
author
lain
<lain@soykaf.club>
Sun, 20 Jan 2019 09:57:49 +0000
(10:57 +0100)
committer
lain
<lain@soykaf.club>
Sun, 20 Jan 2019 09:57:49 +0000
(10:57 +0100)
lib/pleroma/user.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index 87815e11c9dd0f26598a0f7466661c18352b8b1c..955808e285ebee00bd81d7e3afb2334a353587b3 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-686,7
+686,11
@@
defmodule Pleroma.User do
fts_results = do_search(fts_search_subquery(query), for_user)
- trigram_results = do_search(trigram_search_subquery(query), for_user)
+ {:ok, trigram_results} =
+ Repo.transaction(fn ->
+ Ecto.Adapters.SQL.query(Repo, "select set_limit(0.25)", [])
+ do_search(trigram_search_subquery(query), for_user)
+ end)
Enum.uniq_by(fts_results ++ trigram_results, & &1.id)
end