Set custom similarity limit.

This commit is contained in:
lain 2019-01-20 10:57:49 +01:00
parent b108aeee08
commit 5834b08fe7

View File

@ -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