Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85595225
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
867 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/lib/mix/tasks/pleroma/search/indexer.ex b/lib/mix/tasks/pleroma/search/indexer.ex
new file mode 100644
index 000000000..c5784df69
--- /dev/null
+++ b/lib/mix/tasks/pleroma/search/indexer.ex
@@ -0,0 +1,26 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Mix.Tasks.Pleroma.Search.Indexer do
+ import Mix.Pleroma
+ import Ecto.Query
+
+ def run(["index"]) do
+ start_pleroma()
+ Pleroma.HTML.compile_scrubbers()
+
+ q =
+ from(a in Pleroma.Activity,
+ limit: 100_000
+ )
+
+ Pleroma.Repo.transaction(fn ->
+ Pleroma.Repo.stream(q, timeout: :infinity)
+ |> Stream.each(fn activity ->
+ Pleroma.Search.add_to_index(activity)
+ end)
+ |> Stream.run()
+ end)
+ end
+end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 18, 10:47 AM (19 h, 17 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1695053
Default Alt Text
(867 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment