Merge search behaviour change, and refactor elasticsearch #28

Merged
floatingghost merged 91 commits from elasticsearch-refactor into develop 2022-06-30 16:55:31 +00:00
Showing only changes of commit a4914add8c - Show all commits

View file

@ -14,17 +14,29 @@ defmodule Mix.Tasks.Pleroma.Search.Meilisearch do
def run(["index"]) do def run(["index"]) do
start_pleroma() 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, _} = {:ok, _} =
meili_post( meili_post(
"/indexes/objects/settings/ranking-rules", "/indexes/objects/settings/ranking-rules",
[ [
"desc(published)", "published:desc",
"words", "words",
"exactness", "exactness",
"proximity", "proximity",
"wordsPosition",
"typo", "typo",
"attribute" "attribute",
"sort"
] ]
) )