logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

search_backend.ex (861B)


  1. defmodule Pleroma.Search.SearchBackend do
  2. @doc """
  3. Search statuses with a query, restricting to only those the user should have access to.
  4. """
  5. @callback search(user :: Pleroma.User.t(), query :: String.t(), options :: [any()]) :: [
  6. Pleroma.Activity.t()
  7. ]
  8. @doc """
  9. Add the object associated with the activity to the search index.
  10. The whole activity is passed, to allow filtering on things such as scope.
  11. """
  12. @callback add_to_index(activity :: Pleroma.Activity.t()) :: :ok | {:error, any()}
  13. @doc """
  14. Remove the object from the index.
  15. Just the object, as opposed to the whole activity, is passed, since the object
  16. is what contains the actual content and there is no need for filtering when removing
  17. from index.
  18. """
  19. @callback remove_from_index(object :: Pleroma.Object.t()) :: :ok | {:error, any()}
  20. end