2021-12-13 13:27:35 -07:00
|
|
|
defmodule Pleroma.Elasticsearch.DocumentMappings.User do
|
|
|
|
def id(obj), do: obj.id
|
|
|
|
|
|
|
|
def encode(%{actor_type: "Person"} = user) do
|
|
|
|
%{
|
|
|
|
timestamp: user.inserted_at,
|
|
|
|
instance: URI.parse(user.ap_id).host,
|
|
|
|
nickname: user.nickname,
|
2021-12-14 06:53:46 -07:00
|
|
|
bio: user.bio,
|
|
|
|
display_name: user.name
|
2021-12-13 13:27:35 -07:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|