2021-12-14 12:37:10 +00:00
|
|
|
defmodule Pleroma.Elasticsearch.DocumentMappings.Hashtag do
|
|
|
|
def id(obj), do: obj.id
|
|
|
|
|
2021-12-16 16:05:18 +00:00
|
|
|
def encode(%{timestamp: _} = hashtag) do
|
|
|
|
%{
|
|
|
|
hashtag: hashtag.name,
|
2021-12-16 16:05:33 +00:00
|
|
|
timestamp: hashtag.timestamp
|
|
|
|
}
|
2021-12-16 16:05:18 +00:00
|
|
|
end
|
|
|
|
|
2021-12-14 12:37:10 +00:00
|
|
|
def encode(hashtag) do
|
|
|
|
%{
|
|
|
|
hashtag: hashtag.name,
|
2021-12-16 16:05:18 +00:00
|
|
|
timestamp: hashtag.inserted_at
|
2021-12-14 12:37:10 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|