add timestamp
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Thu, 16 Dec 2021 16:05:18 +0000 (16:05 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Thu, 16 Dec 2021 16:05:18 +0000 (16:05 +0000)
lib/pleroma/elasticsearch/document_mappings/hashtag.ex

index ddf91231c1eafa965655a55b7ae903a970b2a386..508e32131f7ce1aa2e8f9034aa3c884676780266 100644 (file)
@@ -1,10 +1,17 @@
 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,
-      timestamp: hashtag.timestamp
+      timestamp: hashtag.inserted_at
     }
   end
 end