summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2024-11-21 14:29:26 +0000
committerlain <lain@soykaf.club>2024-11-21 14:29:26 +0000
commitd92d6132f2acc1d123de4ced869b575e1a8e8785 (patch)
tree32d4098cff8d8bfebe0bff920a049705b0275e15
parent2482d561536d4c37eacf7a57503ea9e888ecd1f4 (diff)
parent462a6a2000d10e3b6047bc72143ff239caf40186 (diff)
downloadpleroma-d92d6132f2acc1d123de4ced869b575e1a8e8785.tar.gz
pleroma-d92d6132f2acc1d123de4ced869b575e1a8e8785.zip
Merge branch 'meilisearch/misc-fixes' into 'develop'
Miscellaneous fixes for Meilisearch See merge request pleroma/pleroma!4296
-rw-r--r--changelog.d/meilisearch-misc-fixes.fix1
-rw-r--r--lib/mix/tasks/pleroma/search/meilisearch.ex6
-rw-r--r--lib/pleroma/search/meilisearch.ex1
3 files changed, 5 insertions, 3 deletions
diff --git a/changelog.d/meilisearch-misc-fixes.fix b/changelog.d/meilisearch-misc-fixes.fix
new file mode 100644
index 000000000..0f127d3a8
--- /dev/null
+++ b/changelog.d/meilisearch-misc-fixes.fix
@@ -0,0 +1 @@
+Miscellaneous fixes for Meilisearch support
diff --git a/lib/mix/tasks/pleroma/search/meilisearch.ex b/lib/mix/tasks/pleroma/search/meilisearch.ex
index 8379a0c25..edce9e871 100644
--- a/lib/mix/tasks/pleroma/search/meilisearch.ex
+++ b/lib/mix/tasks/pleroma/search/meilisearch.ex
@@ -9,7 +9,7 @@ defmodule Mix.Tasks.Pleroma.Search.Meilisearch do
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()
@@ -28,7 +28,7 @@ defmodule Mix.Tasks.Pleroma.Search.Meilisearch do
end
{:ok, _} =
- meili_post(
+ meili_put(
"/indexes/objects/settings/ranking-rules",
[
"published:desc",
@@ -42,7 +42,7 @@ defmodule Mix.Tasks.Pleroma.Search.Meilisearch do
)
{:ok, _} =
- meili_post(
+ meili_put(
"/indexes/objects/settings/searchable-attributes",
[
"content"
diff --git a/lib/pleroma/search/meilisearch.ex b/lib/pleroma/search/meilisearch.ex
index 9bba5b30f..cafae8099 100644
--- a/lib/pleroma/search/meilisearch.ex
+++ b/lib/pleroma/search/meilisearch.ex
@@ -122,6 +122,7 @@ defmodule Pleroma.Search.Meilisearch do
# Only index public or unlisted Notes
if not is_nil(object) and object.data["type"] == "Note" and
not is_nil(object.data["content"]) and
+ not is_nil(object.data["published"]) and
(Pleroma.Constants.as_public() in object.data["to"] or
Pleroma.Constants.as_public() in object.data["cc"]) and
object.data["content"] not in ["", "."] do