aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-11-20 16:26:43 +0100
committerlain <lain@soykaf.club>2020-11-20 16:26:43 +0100
commit9a1e5f5d48ef9f3b5a817c02dc8820aa99a6f693 (patch)
treec07748b60b4a6795dbfdb354af71f8e723505496 /lib
parenta407e33c78121abf880f257d291f45ed28b55eeb (diff)
downloadpleroma-9a1e5f5d48ef9f3b5a817c02dc8820aa99a6f693.tar.gz
Search: Change search method based on detected pg version
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/activity/search.ex7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/activity/search.ex b/lib/pleroma/activity/search.ex
index cc98e2d06..ea9783225 100644
--- a/lib/pleroma/activity/search.ex
+++ b/lib/pleroma/activity/search.ex
@@ -19,7 +19,12 @@ defmodule Pleroma.Activity.Search do
offset = Keyword.get(options, :offset, 0)
author = Keyword.get(options, :author)
- search_function = Pleroma.Config.get([:instance, :search_function], :plain)
+ search_function =
+ if Application.get_env(:postgres, :version) >= 11 do
+ :websearch
+ else
+ :plain
+ end
Activity
|> Activity.with_preloaded_object()