Add a message with a count of posts to index
This commit is contained in:
parent
2c7d973af7
commit
a67f9da5cc
|
@ -38,7 +38,7 @@ def run(["index"]) do
|
||||||
|
|
||||||
Pleroma.Repo.transaction(
|
Pleroma.Repo.transaction(
|
||||||
fn ->
|
fn ->
|
||||||
Pleroma.Repo.stream(
|
query =
|
||||||
from(Pleroma.Object,
|
from(Pleroma.Object,
|
||||||
# Only index public posts which are notes and have some text
|
# Only index public posts which are notes and have some text
|
||||||
where:
|
where:
|
||||||
|
@ -46,7 +46,13 @@ def run(["index"]) do
|
||||||
fragment("LENGTH(data->>'content') > 0") and
|
fragment("LENGTH(data->>'content') > 0") and
|
||||||
fragment("data->'to' \\? ?", ^Pleroma.Constants.as_public()),
|
fragment("data->'to' \\? ?", ^Pleroma.Constants.as_public()),
|
||||||
order_by: [desc: fragment("data->'published'")]
|
order_by: [desc: fragment("data->'published'")]
|
||||||
),
|
)
|
||||||
|
|
||||||
|
count = query |> Pleroma.Repo.aggregate(:count, :data)
|
||||||
|
IO.puts("Entries to index: #{count}")
|
||||||
|
|
||||||
|
Pleroma.Repo.stream(
|
||||||
|
query,
|
||||||
timeout: :infinity
|
timeout: :infinity
|
||||||
)
|
)
|
||||||
|> Stream.map(&Pleroma.Search.Meilisearch.object_to_search_data/1)
|
|> Stream.map(&Pleroma.Search.Meilisearch.object_to_search_data/1)
|
||||||
|
|
Loading…
Reference in New Issue