summaryrefslogtreecommitdiff
path: root/lib/mix
diff options
context:
space:
mode:
authorEkaterina Vaartis <vaartis@kotobank.ch>2021-12-20 19:05:59 +0300
committerEkaterina Vaartis <vaartis@kotobank.ch>2022-10-10 20:19:09 +0300
commit571533ae2618478f26db312e52265e143356debd (patch)
treedf261132d194051b63959a6ae5f6eebdf01d3e46 /lib/mix
parent3179ed0921197a8a8f32a519c7d41dc09011024d (diff)
downloadpleroma-571533ae2618478f26db312e52265e143356debd.tar.gz
pleroma-571533ae2618478f26db312e52265e143356debd.zip
Don't support meilisearch < 0.24.0, since it breaks things
Diffstat (limited to 'lib/mix')
-rw-r--r--lib/mix/tasks/pleroma/search/meilisearch.ex18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/mix/tasks/pleroma/search/meilisearch.ex b/lib/mix/tasks/pleroma/search/meilisearch.ex
index 021552f7b..5098668ad 100644
--- a/lib/mix/tasks/pleroma/search/meilisearch.ex
+++ b/lib/mix/tasks/pleroma/search/meilisearch.ex
@@ -14,17 +14,29 @@ defmodule Mix.Tasks.Pleroma.Search.Meilisearch do
def run(["index"]) do
start_pleroma()
+ meili_version =
+ (
+ {:ok, result} = meili_get("/version")
+
+ result["pkgVersion"]
+ )
+
+ # The ranking rule syntax was changed but nothing about that is mentioned in the changelog
+ if not Version.match?(meili_version, ">= 0.24.0") do
+ raise "Meilisearch <0.24.0 not supported"
+ end
+
{:ok, _} =
meili_post(
"/indexes/objects/settings/ranking-rules",
[
- "desc(published)",
+ "published:desc",
"words",
"exactness",
"proximity",
- "wordsPosition",
"typo",
- "attribute"
+ "attribute",
+ "sort"
]
)