diff options
author | lain <lain@soykaf.club> | 2019-01-20 10:57:49 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-01-20 10:57:49 +0100 |
commit | 5834b08fe77250d1dad0f2f6cd148f2fd8f85c09 (patch) | |
tree | 3b68af44a44f79bb8efa8cd3620f333cfa12aa42 /lib | |
parent | b108aeee082949e2e534f8bc406fdacb8924803d (diff) | |
download | pleroma-5834b08fe77250d1dad0f2f6cd148f2fd8f85c09.tar.gz |
Set custom similarity limit.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 87815e11c..955808e28 100644 --- 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 |