From cda1b91b77d49504363cdc5db890e555442d7190 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 29 Jan 2024 12:32:21 +0000 Subject: [PATCH] Update searchindex on reshare --- src/Model/Item.php | 2 ++ src/Model/Post/SearchIndex.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index d4983c5069..000960a6fe 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1451,6 +1451,8 @@ class Item if (in_array($posted_item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT])) { Post\SearchIndex::insert($posted_item['uri-id'], $posted_item['network'], $posted_item['private'], $posted_item['created']); + } elseif ($posted_item['verb'] == Activity::ANNOUNCE) { + Post\SearchIndex::update($posted_item['thr-parent-id']); } if (($posted_item['gravity'] == self::GRAVITY_ACTIVITY) && ($posted_item['verb'] == Activity::ANNOUNCE) && ($posted_item['parent-uri-id'] == $posted_item['thr-parent-id'])) { diff --git a/src/Model/Post/SearchIndex.php b/src/Model/Post/SearchIndex.php index 1fbbe0b3f4..67d6c91d12 100644 --- a/src/Model/Post/SearchIndex.php +++ b/src/Model/Post/SearchIndex.php @@ -63,7 +63,7 @@ class SearchIndex */ public static function update(int $uri_id) { - $searchtext = Post\Engagement::getSearchTextForUriId($uri_id, true); + $searchtext = Post\Engagement::getSearchTextForUriId($uri_id); return DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $uri_id]); }