Add a search backend behaviour
[akkoma] / lib / pleroma / search / database_search.ex
index 5a8b8ca67b9d1e4eeb49f52b12e12b1e9a6d28d3..3735a5fab427f87652d6d203da55ee866facc399 100644 (file)
@@ -13,6 +13,8 @@ defmodule Pleroma.Search.DatabaseSearch do
 
   import Ecto.Query
 
+  @behaviour Pleroma.Search.SearchBackend
+
   def search(user, search_query, options \\ []) do
     index_type = if Pleroma.Config.get([:database, :rum_enabled]), do: :rum, else: :gin
     limit = Enum.min([Keyword.get(options, :limit), 40])
@@ -45,7 +47,10 @@ defmodule Pleroma.Search.DatabaseSearch do
     end
   end
 
+  @impl true
   def add_to_index(_activity), do: nil
+
+  @impl true
   def remove_from_index(_object), do: nil
 
   def maybe_restrict_author(query, %User{} = author) do