Merge branch 'meilisearch/misc-fixes' into 'develop'
Miscellaneous fixes for Meilisearch See merge request pleroma/pleroma!4296
This commit is contained in:
commit
d92d6132f2
3 changed files with 5 additions and 3 deletions
1
changelog.d/meilisearch-misc-fixes.fix
Normal file
1
changelog.d/meilisearch-misc-fixes.fix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Miscellaneous fixes for Meilisearch support
|
|
@ -9,7 +9,7 @@ defmodule Mix.Tasks.Pleroma.Search.Meilisearch do
|
||||||
import Ecto.Query
|
import Ecto.Query
|
||||||
|
|
||||||
import Pleroma.Search.Meilisearch,
|
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
|
def run(["index"]) do
|
||||||
start_pleroma()
|
start_pleroma()
|
||||||
|
@ -28,7 +28,7 @@ def run(["index"]) do
|
||||||
end
|
end
|
||||||
|
|
||||||
{:ok, _} =
|
{:ok, _} =
|
||||||
meili_post(
|
meili_put(
|
||||||
"/indexes/objects/settings/ranking-rules",
|
"/indexes/objects/settings/ranking-rules",
|
||||||
[
|
[
|
||||||
"published:desc",
|
"published:desc",
|
||||||
|
@ -42,7 +42,7 @@ def run(["index"]) do
|
||||||
)
|
)
|
||||||
|
|
||||||
{:ok, _} =
|
{:ok, _} =
|
||||||
meili_post(
|
meili_put(
|
||||||
"/indexes/objects/settings/searchable-attributes",
|
"/indexes/objects/settings/searchable-attributes",
|
||||||
[
|
[
|
||||||
"content"
|
"content"
|
||||||
|
|
|
@ -122,6 +122,7 @@ def object_to_search_data(object) do
|
||||||
# Only index public or unlisted Notes
|
# Only index public or unlisted Notes
|
||||||
if not is_nil(object) and object.data["type"] == "Note" and
|
if not is_nil(object) and object.data["type"] == "Note" and
|
||||||
not is_nil(object.data["content"]) 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["to"] or
|
||||||
Pleroma.Constants.as_public() in object.data["cc"]) and
|
Pleroma.Constants.as_public() in object.data["cc"]) and
|
||||||
object.data["content"] not in ["", "."] do
|
object.data["content"] not in ["", "."] do
|
||||||
|
|
Loading…
Reference in a new issue