Skip posts in indexer where publish date is nil
authorsn0w <me@sn0w.cx>
Thu, 8 Dec 2022 09:04:20 +0000 (10:04 +0100)
committersn0w <me@sn0w.cx>
Fri, 9 Dec 2022 19:56:39 +0000 (20:56 +0100)
lib/pleroma/search/elasticsearch/document_mappings/activity.ex
lib/pleroma/search/meilisearch.ex

index 3a84e991b023f295fc561c86b58e54736b758a31..b77c6e0d296626708a189494186ce64a02b790a9 100644 (file)
@@ -30,7 +30,7 @@ defimpl Elasticsearch.Document, for: Pleroma.Activity do
           trimmed
         end
 
-      if String.length(content) > 1 do
+      if String.length(content) > 1 and not is_nil(data["published"]) do
         {:ok, published, _} = DateTime.from_iso8601(data["published"])
 
         %{
index 77055785832014bf72d275f3eba5bf377dcb6c0a..c36b8f7510275d6e6d7fbcf532cc47b81be6aaf2 100644 (file)
@@ -128,7 +128,7 @@ defmodule Pleroma.Search.Meilisearch do
           trimmed
         end
 
-      if String.length(content) > 1 do
+      if String.length(content) > 1 and not is_nil(data["published"]) do
         {:ok, published, _} = DateTime.from_iso8601(data["published"])
 
         %{