don't set primary just yet
[akkoma] / lib / pleroma / elasticsearch / document_mappings / hashtag.ex
index 1c47d1451d522e57ded33ca98886e531d593eb11..7391983f67e6d0f45723aa8d34fa73f0f4d522e1 100644 (file)
@@ -1,6 +1,17 @@
+# Akkoma: A lightweight social networking server
+# Copyright © 2022-2022 Akkoma Authors <https://git.ihatebeinga.live/IHBAGang/akkoma/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Elasticsearch.DocumentMappings.Hashtag do
   def id(obj), do: obj.id
 
+  def encode(%{timestamp: _} = hashtag) do
+    %{
+      hashtag: hashtag.name,
+      timestamp: hashtag.timestamp
+    }
+  end
+
   def encode(hashtag) do
     %{
       hashtag: hashtag.name,