7391983f67e6d0f45723aa8d34fa73f0f4d522e1
[akkoma] / lib / pleroma / elasticsearch / document_mappings / hashtag.ex
1 # Akkoma: A lightweight social networking server
2 # Copyright © 2022-2022 Akkoma Authors <https://git.ihatebeinga.live/IHBAGang/akkoma/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Elasticsearch.DocumentMappings.Hashtag do
6 def id(obj), do: obj.id
7
8 def encode(%{timestamp: _} = hashtag) do
9 %{
10 hashtag: hashtag.name,
11 timestamp: hashtag.timestamp
12 }
13 end
14
15 def encode(hashtag) do
16 %{
17 hashtag: hashtag.name,
18 timestamp: hashtag.inserted_at
19 }
20 end
21 end