akkoma/lib/pleroma/elasticsearch/document_mappings/user.ex
2021-12-14 13:53:46 +00:00

14 lines
316 B
Elixir

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,
bio: user.bio,
display_name: user.name
}
end
end