logo

pleroma

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

search.ex (729B)


  1. defmodule Pleroma.Search do
  2. alias Pleroma.Workers.SearchIndexingWorker
  3. def add_to_index(%Pleroma.Activity{id: activity_id}) do
  4. SearchIndexingWorker.new(%{"op" => "add_to_index", "activity" => activity_id})
  5. |> Oban.insert()
  6. end
  7. def remove_from_index(%Pleroma.Object{id: object_id}) do
  8. SearchIndexingWorker.new(%{"op" => "remove_from_index", "object" => object_id})
  9. |> Oban.insert()
  10. end
  11. def search(query, options) do
  12. search_module = Pleroma.Config.get([Pleroma.Search, :module])
  13. search_module.search(options[:for_user], query, options)
  14. end
  15. def healthcheck_endpoints do
  16. search_module = Pleroma.Config.get([Pleroma.Search, :module])
  17. search_module.healthcheck_endpoints()
  18. end
  19. end