QdrantSearch: Fix actor / author restriction
This commit is contained in:
parent
94e4f21589
commit
a566ad56e1
@ -71,9 +71,9 @@ defmodule Pleroma.Search.QdrantSearch do
|
|||||||
offset: options[:offset] || 0
|
offset: options[:offset] || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if options[:actor] do
|
if author = options[:author] do
|
||||||
Map.put(base, :filter, %{
|
Map.put(base, :filter, %{
|
||||||
must: [%{key: "actor", match: %{value: options[:actor].ap_id}}]
|
must: [%{key: "actor", match: %{value: author.ap_id}}]
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
base
|
base
|
||||||
|
@ -98,7 +98,7 @@ defmodule Pleroma.Search.QdrantSearchTest do
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
results =
|
results =
|
||||||
QdrantSearch.search(nil, "guys i just don't wanna leave the swamp", %{actor: user})
|
QdrantSearch.search(nil, "guys i just don't wanna leave the swamp", %{author: user})
|
||||||
|
|
||||||
assert results == [activity]
|
assert results == [activity]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user