## [Unreleased]
+### Fixed
+- Compatibility with latest meilisearch
+- Resolution of nested mix tasks (i.e search.meilisearch) in OTP releases
+
### Removed
- Non-finch HTTP adapters. `:tesla, :adapter` is now highly recommended to be set to the default.
import Ecto.Query
import Pleroma.Search.Meilisearch,
- only: [meili_post: 2, meili_put: 2, meili_get: 1, meili_delete!: 1]
+ only: [meili_put: 2, meili_get: 1, meili_delete!: 1]
def run(["index"]) do
start_pleroma()
end
{:ok, _} =
- meili_post(
+ meili_put(
"/indexes/objects/settings/ranking-rules",
[
"published:desc",
)
{:ok, _} =
- meili_post(
+ meili_put(
"/indexes/objects/settings/searchable-attributes",
[
"content"
)
with {:ok, res} <- result do
- if not Map.has_key?(res, "uid") do
+ if not Map.has_key?(res, "indexUid") do
IO.puts("\nFailed to index: #{inspect(result)}")
end
else
module = Module.split(module)
match?(["Mix", "Tasks", "Pleroma" | _], module) and
- String.downcase(List.last(module)) == task
+ task_match?(module, task)
end)
if module do
end
end
+ defp task_match?(["Mix", "Tasks", "Pleroma" | module_path], task) do
+ module_path
+ |> Enum.join(".")
+ |> String.downcase()
+ |> String.equivalent?(String.downcase(task))
+ end
+
def migrate(args) do
Mix.Tasks.Pleroma.Ecto.Migrate.run(args)
end