Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
5834b08f
Commit
5834b08f
authored
Jan 20, 2019
by
lain
Browse files
Set custom similarity limit.
parent
b108aeee
Pipeline
#6400
passed with stages
in 6 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
5834b08f
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment