only return create objects for ES search #165
1 changed files with 5 additions and 2 deletions
|
@ -62,8 +62,11 @@ def search(user, query, options) do
|
||||||
Task.async(fn ->
|
Task.async(fn ->
|
||||||
q = es_query(:activity, parsed_query, offset, limit)
|
q = es_query(:activity, parsed_query, offset, limit)
|
||||||
|
|
||||||
Pleroma.Search.Elasticsearch.Store.search(:activities, q)
|
:activities
|
||||||
|> Enum.filter(fn x -> Visibility.visible_for_user?(x, user) end)
|
|> 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)
|
end)
|
||||||
|
|
||||||
activity_results = Task.await(activity_task)
|
activity_results = Task.await(activity_task)
|
||||||
|
|
Loading…
Reference in a new issue