1 defmodule Pleroma.Workers.SearchIndexingWorker do
2 use Pleroma.Workers.WorkerHelper, queue: "search_indexing"
6 def perform(%Job{args: %{"op" => "add_to_index", "activity" => activity_id}}) do
7 activity = Pleroma.Activity.get_by_id_with_object(activity_id)
9 search_module = Pleroma.Config.get([Pleroma.Search, :module])
11 search_module.add_to_index(activity)
16 def perform(%Job{args: %{"op" => "remove_from_index", "object" => object_id}}) do
17 search_module = Pleroma.Config.get([Pleroma.Search, :module])
19 # Fake the object so we can remove it from the index without having to keep it in the DB
20 search_module.remove_from_index(%Pleroma.Object{id: object_id})