Update searchindex on reshare

This commit is contained in:
Michael 2024-01-29 12:32:21 +00:00
parent 7c43b41f0b
commit cda1b91b77
2 changed files with 3 additions and 1 deletions

View File

@ -1451,6 +1451,8 @@ class Item
if (in_array($posted_item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT])) { 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']); 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'])) { if (($posted_item['gravity'] == self::GRAVITY_ACTIVITY) && ($posted_item['verb'] == Activity::ANNOUNCE) && ($posted_item['parent-uri-id'] == $posted_item['thr-parent-id'])) {

View File

@ -63,7 +63,7 @@ class SearchIndex
*/ */
public static function update(int $uri_id) 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]); return DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $uri_id]);
} }