Commit 5834b08f authored by lain's avatar lain
Browse files

Set custom similarity limit.

parent b108aeee
Pipeline #6400 passed with stages
in 6 minutes and 44 seconds
......@@ -686,7 +686,11 @@ def search(query, resolve \\ false, for_user \\ nil) 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment