defmodule Pleroma.Search do
- @type search_map :: %{
- statuses: [map],
- accounts: [map],
- hashtags: [map]
- }
+ def add_to_index(activity) do
+ search_module = Pleroma.Config.get([Pleroma.Search, :module])
- @doc """
- Searches for stuff
- """
- @callback search(map, map, keyword) :: search_map
+ ConcurrentLimiter.limit(Pleroma.Search, fn ->
+ Task.start(fn -> search_module.add_to_index(activity) end)
+ end)
+ end
+
+ def remove_from_index(object) do
+ # Also delete from search index
+ search_module = Pleroma.Config.get([Pleroma.Search, :module])
+
+ ConcurrentLimiter.limit(Pleroma.Search, fn ->
+ Task.start(fn -> search_module.remove_from_index(object) end)
+ end)
+ end
end
+++ /dev/null
-defmodule Pleroma.Search do
- def add_to_index(activity) do
- search_module = Pleroma.Config.get([Pleroma.Search, :module])
-
- ConcurrentLimiter.limit(Pleroma.Search, fn ->
- Task.start(fn -> search_module.add_to_index(activity) end)
- end)
- end
-
- def remove_from_index(object) do
- # Also delete from search index
- search_module = Pleroma.Config.get([Pleroma.Search, :module])
-
- ConcurrentLimiter.limit(Pleroma.Search, fn ->
- Task.start(fn -> search_module.remove_from_index(object) end)
- end)
- end
-end