# Only index public posts which are notes and have some text
where:
fragment("data->>'type' = 'Note'") and
- fragment("LENGTH(data->>'source') > 0") and
+ fragment("LENGTH(data->>'content') > 0") and
fragment("data->'to' \\? ?", ^Pleroma.Constants.as_public()),
order_by: [desc: fragment("data->'published'")]
),
data = object.data
{:ok, published, _} = DateTime.from_iso8601(data["published"])
+ {:ok, content} = FastSanitize.strip_tags(data["content"])
%{
id: object.id,
- source: data["source"],
+ content: content,
ap: data["id"],
published: published |> DateTime.to_unix()
}
endpoint = Pleroma.Config.get([Pleroma.Search.Meilisearch, :url])
- {:ok, result} =
- Pleroma.HTTP.request(:delete, "#{endpoint}/indexes/objects/documents", "", [], [])
-
- if not Map.has_key?(Jason.decode!(result.body), "updateId") do
- IO.puts("Failed to clear: #{result}")
- end
+ {:ok, _} = Pleroma.HTTP.request(:delete, "#{endpoint}/indexes/objects", "", [], [])
end
end