af858fc46965198f67fafed29fc59e24f2b2c1d0
[akkoma] / lib / pleroma / search.ex
1 defmodule Pleroma.Search do
2 alias Pleroma.Workers.SearchIndexingWorker
3
4 def add_to_index(activity) do
5 SearchIndexingWorker.enqueue("add_to_index", %{"activity" => activity.id})
6 end
7
8 def remove_from_index(object) do
9 SearchIndexingWorker.enqueue("remove_from_index", %{"object" => object.id})
10 end
11
12 def search(query, options) do
13 search_module = Pleroma.Config.get([Pleroma.Search, :module], Pleroma.Activity)
14
15 search_module.search(options[:for_user], query, options)
16 end
17 end