logo

pleroma

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

search_backend.ex (1306B)


  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. @doc """
  21. Create the index
  22. """
  23. @callback create_index() :: :ok | {:error, any()}
  24. @doc """
  25. Drop the index
  26. """
  27. @callback drop_index() :: :ok | {:error, any()}
  28. @doc """
  29. Healthcheck endpoints of search backend infrastructure to monitor for controlling
  30. processing of jobs in the Oban queue.
  31. It is expected a 200 response is healthy and other responses are unhealthy.
  32. """
  33. @callback healthcheck_endpoints :: list() | nil
  34. end