forked from mirrors/akkoma
Set custom similarity limit.
This commit is contained in:
parent
b108aeee08
commit
5834b08fe7
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue