mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-24 05:47:41 -04:00
Meilisearch nils errors
This commit is contained in:
parent
9953b0da59
commit
ee5df42cd7
1 changed files with 4 additions and 1 deletions
|
@ -155,7 +155,8 @@ defmodule Pleroma.Search.Meilisearch do
|
|||
end
|
||||
|
||||
@impl true
|
||||
def add_to_index(activity) do
|
||||
@spec add_to_index(Activity.t()) :: :ok | {:error, any()}
|
||||
def add_to_index(%Activity{} = activity) do
|
||||
maybe_search_data = object_to_search_data(activity.object)
|
||||
|
||||
if activity.data["type"] == "Create" and maybe_search_data do
|
||||
|
@ -180,6 +181,8 @@ defmodule Pleroma.Search.Meilisearch do
|
|||
end
|
||||
end
|
||||
|
||||
def add_to_index(_), do: :ok
|
||||
|
||||
@impl true
|
||||
def remove_from_index(object) do
|
||||
meili_delete("/indexes/objects/documents/#{object.id}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue