From 9134ef5ecb72f6fe2042f978be3deef41c9b4ce7 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Thu, 16 Dec 2021 16:05:18 +0000 Subject: [PATCH] add timestamp --- lib/pleroma/elasticsearch/document_mappings/hashtag.ex | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/elasticsearch/document_mappings/hashtag.ex b/lib/pleroma/elasticsearch/document_mappings/hashtag.ex index ddf91231c..508e32131 100644 --- a/lib/pleroma/elasticsearch/document_mappings/hashtag.ex +++ b/lib/pleroma/elasticsearch/document_mappings/hashtag.ex @@ -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