2022-06-30 12:44:31 -06:00
|
|
|
# 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 do
|
|
|
|
use Mix.Task
|
|
|
|
import Mix.Pleroma
|
|
|
|
|
|
|
|
@shortdoc "Manages elasticsearch"
|
|
|
|
|
|
|
|
def run(["import", "activities" | _rest]) do
|
|
|
|
start_pleroma()
|
2022-07-06 12:57:00 -06:00
|
|
|
IO.inspect(Pleroma.Config.get([Pleroma.Search.Elasticsearch.Cluster, :indexes, :activities]))
|
2022-06-30 12:44:31 -06:00
|
|
|
|
2022-07-06 12:57:00 -06:00
|
|
|
IO.inspect(
|
|
|
|
Elasticsearch.Index.Bulk.upload(
|
|
|
|
Pleroma.Search.Elasticsearch.Cluster,
|
|
|
|
"activities",
|
|
|
|
Pleroma.Config.get([Pleroma.Search.Elasticsearch.Cluster, :indexes, :activities])
|
|
|
|
)
|
2022-06-30 12:44:31 -06:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|