From 4c0911592b7f76e75d6741511a07bc39573d6d6a Mon Sep 17 00:00:00 2001 From: sn0w Date: Thu, 8 Dec 2022 10:04:20 +0100 Subject: [PATCH] Skip posts in indexer where publish date is nil --- lib/pleroma/search/elasticsearch/document_mappings/activity.ex | 2 +- lib/pleroma/search/meilisearch.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/search/elasticsearch/document_mappings/activity.ex b/lib/pleroma/search/elasticsearch/document_mappings/activity.ex index 3a84e991b..b77c6e0d2 100644 --- a/lib/pleroma/search/elasticsearch/document_mappings/activity.ex +++ b/lib/pleroma/search/elasticsearch/document_mappings/activity.ex @@ -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"]) %{ diff --git a/lib/pleroma/search/meilisearch.ex b/lib/pleroma/search/meilisearch.ex index 770557858..c36b8f751 100644 --- a/lib/pleroma/search/meilisearch.ex +++ b/lib/pleroma/search/meilisearch.ex @@ -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"]) %{ -- 2.45.2