only return create objects for ES search #165

Merged
floatingghost merged 2 commits from elasticsearch-create-only into develop 2022-08-16 23:24:19 +00:00
Showing only changes of commit a215f01cce - Show all commits

View file

@ -62,8 +62,11 @@ def search(user, query, options) do
Task.async(fn ->
q = es_query(:activity, parsed_query, offset, limit)
Pleroma.Search.Elasticsearch.Store.search(:activities, q)
|> Enum.filter(fn x -> Visibility.visible_for_user?(x, user) end)
:activities
|> Pleroma.Search.Elasticsearch.Store.search(q)
|> Enum.filter(fn x ->
x.data["type"] == "Create" && x.object.data["type"] == "Note" && Visibility.visible_for_user?(x, user)
end)
end)
activity_results = Task.await(activity_task)