From ee9a68e40cf1bfca755032599baadb3f3890a2ad Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 17 Jan 2024 19:46:22 +0000 Subject: [PATCH 1/6] New table "post-searchindex" --- .../Repository/UserDefinedChannel.php | 12 +---- src/Content/Text/BBCode.php | 13 +++-- src/Model/Item.php | 16 ++++++ src/Model/Post/Content.php | 25 +++++---- src/Model/Post/Engagement.php | 53 +++++++++++++------ src/Module/Api/Mastodon/Search.php | 8 ++- src/Module/Conversation/Timeline.php | 6 +-- static/dbstructure.config.php | 15 +++++- 8 files changed, 97 insertions(+), 51 deletions(-) diff --git a/src/Content/Conversation/Repository/UserDefinedChannel.php b/src/Content/Conversation/Repository/UserDefinedChannel.php index 0452b6dd2b..0fb282099d 100644 --- a/src/Content/Conversation/Repository/UserDefinedChannel.php +++ b/src/Content/Conversation/Repository/UserDefinedChannel.php @@ -156,7 +156,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository return true; } - return $this->db->select('check-full-text-search', [], ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $this->escapeKeywords($searchtext)]) !== false; + return $this->db->select('check-full-text-search', [], ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), Engagement::escapeKeywords($searchtext)]) !== false; } /** @@ -310,15 +310,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository private function inFulltext(string $fullTextSearch): bool { - return $this->db->exists('check-full-text-search', ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $this->escapeKeywords($fullTextSearch)]); - } - - private function escapeKeywords(string $fullTextSearch): string - { - foreach (Engagement::KEYWORDS as $keyword) { - $fullTextSearch = preg_replace('~(' . $keyword . ':.[\w@\.-]+)~', '"$1"', $fullTextSearch); - } - return $fullTextSearch; + return $this->db->exists('check-full-text-search', ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), Engagement::escapeKeywords($fullTextSearch)]); } private function getUserCondition() diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 8396a95cf8..a824340300 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -255,12 +255,15 @@ class BBCode // Removes attachments $text = self::removeAttachment($text); - // Add images because of possible alt texts + // Add text from attached media if (!empty($uri_id)) { - $text = Post\Media::addAttachmentsToBody($uri_id, $text, [Post\Media::IMAGE]); - - foreach (Post\Media::getByURIId($uri_id, [Post\Media::HTML]) as $media) { - $text .= ' ' . $media['name'] . ' ' . $media['description']; + foreach (Post\Media::getByURIId($uri_id) as $media) { + if (!empty($media['description']) && (stripos($text, $media['description']) === false)) { + $text .= ' ' . $media['description']; + } + if (in_array($media['type'], [Post\Media::HTML, Post\Media::ACTIVITY]) && !empty($media['name']) && (stripos($text, $media['name']) === false)) { + $text .= ' ' . $media['name']; + } } } diff --git a/src/Model/Item.php b/src/Model/Item.php index 91e7e8613e..d28009a4e6 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -34,6 +34,7 @@ use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Post\Category; @@ -243,6 +244,11 @@ class Item $content_fields['raw-body'] = BBCode::removeAttachment($content_fields['raw-body']); Post\Content::update($item['uri-id'], $content_fields); + + $searchtext = Post\Engagement::getSearchTextForUriId($item['uri-id'], true); + DBA::update('post-engagement', ['searchtext' => $searchtext], ['uri-id' => $item['uri-id']]); + DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $item['uri-id']]); + } if (!empty($fields['file'])) { @@ -1443,6 +1449,16 @@ class Item } $engagement_uri_id = Post\Engagement::storeFromItem($posted_item); + + if (in_array($item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT])) { + $search = [ + 'uri-id' => $posted_item['uri-id'], + 'network' => $posted_item['network'], + 'private' => $posted_item['private'], + 'searchtext' => Post\Engagement::getSearchTextForUriId($posted_item['uri-id']), + ]; + DBA::insert('post-searchindex', $search, Database::INSERT_IGNORE); + } if (($posted_item['gravity'] == self::GRAVITY_ACTIVITY) && ($posted_item['verb'] == Activity::ANNOUNCE) && ($posted_item['parent-uri-id'] == $posted_item['thr-parent-id'])) { self::reshareChannelPost($posted_item['thr-parent-id'], $posted_item['author-id']); diff --git a/src/Model/Post/Content.php b/src/Model/Post/Content.php index 7253f9a342..74cfbfe6f5 100644 --- a/src/Model/Post/Content.php +++ b/src/Model/Post/Content.php @@ -22,11 +22,10 @@ namespace Friendica\Model\Post; use \BadMethodCallException; -use Friendica\Core\Protocol; use Friendica\Database\Database; use Friendica\Database\DBA; -use Friendica\Database\DBStructure; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; class Content @@ -109,9 +108,12 @@ class Content */ public static function getURIIdListBySearch(string $search, int $uid = 0, int $start = 0, int $limit = 100, int $last_uriid = 0) { - $condition = ["`uri-id` IN (SELECT `uri-id` FROM `post-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE)) - AND (`uid` = ? OR (`uid` = ? AND NOT `global`)) AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))", - str_replace('@', ' ', $search), 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0]; + $search = Post\Engagement::escapeKeywords($search); + if ($uid != 0) { + $condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) and (private = ? OR `uri-id` in (SELECT `uri-id` FROM `post-user` where `uid` = ?))", $search, Item::PUBLIC, $uid]; + } else { + $condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) and private = ?", $search, Item::PUBLIC]; + } if (!empty($last_uriid)) { $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $last_uriid]); @@ -122,7 +124,7 @@ class Content 'limit' => [$start, $limit] ]; - $tags = Post::select(['uri-id'], $condition, $params); + $tags = DBA::select('post-searchindex', ['uri-id'], $condition, $params); $uriids = []; while ($tag = DBA::fetch($tags)) { @@ -135,9 +137,12 @@ class Content public static function countBySearch(string $search, int $uid = 0) { - $condition = ["`uri-id` IN (SELECT `uri-id` FROM `post-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE)) - AND (`uid` = ? OR (`uid` = ? AND NOT `global`)) AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))", - str_replace('@', ' ', $search), 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0]; - return Post::count($condition); + $search = Post\Engagement::escapeKeywords($search); + if ($uid != 0) { + $condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) and (private = ? OR `uri-id` in (SELECT `uri-id` FROM `post-user` where `uid` = ?))", $search, Item::PUBLIC, $uid]; + } else { + $condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) and private = ?", $search, Item::PUBLIC]; + } + return DBA::count('post-searchindex', $condition); } } diff --git a/src/Model/Post/Engagement.php b/src/Model/Post/Engagement.php index 61f73948de..5047d71dd2 100644 --- a/src/Model/Post/Engagement.php +++ b/src/Model/Post/Engagement.php @@ -146,7 +146,7 @@ class Engagement 'owner-contact-type' => $author['contact-type'], 'owner-nick' => $author['nick'], 'owner-addr' => $author['addr'], - 'author-gsid' => $author['gsid'], + 'owner-gsid' => $author['gsid'], ]; foreach ($receivers as $receiver) { @@ -158,6 +158,21 @@ class Engagement return self::getSearchText($item, $receivers, $tags); } + public static function getSearchTextForUriId(int $uri_id, bool $refresh = false): string + { + if (!$refresh) { + $engagement = DBA::selectFirst('post-engagement', ['searchtext'], ['uri-id' => $uri_id]); + if (!empty($engagement['searchtext'])) { + return $engagement['searchtext']; + } + } + + $post = Post::selectFirstPost(['uri-id', 'network', 'title', 'content-warning', 'body', 'private', + 'author-id', 'author-contact-type', 'author-nick', 'author-addr', 'author-gsid', + 'owner-id', 'owner-contact-type', 'owner-nick', 'owner-addr', 'owner-gsid'], ['uri-id' => $uri_id]); + return self::getSearchTextForItem($post); + } + private static function getSearchTextForItem(array $item): string { $receivers = array_column(Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION, Tag::AUDIENCE]), 'url'); @@ -167,24 +182,24 @@ class Engagement private static function getSearchText(array $item, array $receivers, array $tags): string { - $body = '[nosmile]network:' . $item['network']; + $body = '[nosmile]network_' . $item['network']; if (!empty($item['author-gsid'])) { $gserver = DBA::selectFirst('gserver', ['platform', 'nurl'], ['id' => $item['author-gsid']]); $platform = preg_replace( '/[\W]/', '', $gserver['platform'] ?? ''); if (!empty($platform)) { - $body .= ' platform:' . $platform; + $body .= ' platform_' . $platform; } - $body .= ' server:' . parse_url($gserver['nurl'], PHP_URL_HOST); + $body .= ' server_' . parse_url($gserver['nurl'], PHP_URL_HOST); } if (($item['owner-contact-type'] == Contact::TYPE_COMMUNITY) && !empty($item['owner-gsid']) && ($item['owner-gsid'] != ($item['author-gsid'] ?? 0))) { $gserver = DBA::selectFirst('gserver', ['platform', 'nurl'], ['id' => $item['owner-gsid']]); $platform = preg_replace( '/[\W]/', '', $gserver['platform'] ?? ''); - if (!empty($platform) && !strpos($body, 'platform:' . $platform)) { - $body .= ' platform:' . $platform; + if (!empty($platform) && !strpos($body, 'platform_' . $platform)) { + $body .= ' platform_' . $platform; } - $body .= ' server:' . parse_url($gserver['nurl'], PHP_URL_HOST); + $body .= ' server_' . parse_url($gserver['nurl'], PHP_URL_HOST); } switch ($item['private']) { @@ -212,16 +227,16 @@ class Engagement } if ($item['author-contact-type'] == Contact::TYPE_COMMUNITY) { - $body .= ' group:' . $item['author-nick'] . ' group:' . $item['author-addr']; + $body .= ' group_' . $item['author-nick'] . ' group_' . $item['author-addr']; } elseif (in_array($item['author-contact-type'], [Contact::TYPE_PERSON, Contact::TYPE_NEWS, Contact::TYPE_ORGANISATION])) { - $body .= ' from:' . $item['author-nick'] . ' from:' . $item['author-addr']; + $body .= ' from_' . $item['author-nick'] . ' from_' . $item['author-addr']; } if ($item['author-id'] != $item['owner-id']) { if ($item['owner-contact-type'] == Contact::TYPE_COMMUNITY) { - $body .= ' group:' . $item['owner-nick'] . ' group:' . $item['owner-addr']; + $body .= ' group_' . $item['owner-nick'] . ' group_' . $item['owner-addr']; } elseif (in_array($item['owner-contact-type'], [Contact::TYPE_PERSON, Contact::TYPE_NEWS, Contact::TYPE_ORGANISATION])) { - $body .= ' from:' . $item['owner-nick'] . ' from:' . $item['owner-addr']; + $body .= ' from_' . $item['owner-nick'] . ' from_' . $item['owner-addr']; } } @@ -231,15 +246,15 @@ class Engagement continue; } - if (($contact['contact-type'] == Contact::TYPE_COMMUNITY) && !strpos($body, 'group:' . $contact['addr'])) { - $body .= ' group:' . $contact['nick'] . ' group:' . $contact['addr']; + if (($contact['contact-type'] == Contact::TYPE_COMMUNITY) && !strpos($body, 'group_' . $contact['addr'])) { + $body .= ' group_' . $contact['nick'] . ' group_' . $contact['addr']; } elseif (in_array($contact['contact-type'], [Contact::TYPE_PERSON, Contact::TYPE_NEWS, Contact::TYPE_ORGANISATION])) { - $body .= ' to:' . $contact['nick'] . ' to:' . $contact['addr']; + $body .= ' to_' . $contact['nick'] . ' to_' . $contact['addr']; } } foreach ($tags as $tag) { - $body .= ' tag:' . $tag; + $body .= ' tag_' . $tag; } $body .= ' ' . $item['title'] . ' ' . $item['content-warning'] . ' ' . $item['body']; @@ -293,4 +308,12 @@ class Engagement return DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour'); } + + public static function escapeKeywords(string $fullTextSearch): string + { + foreach (Engagement::KEYWORDS as $keyword) { + $fullTextSearch = preg_replace('~(' . $keyword . '):(.[\w\*@\.-]+)~', '$1_$2', $fullTextSearch); + } + return $fullTextSearch; + } } diff --git a/src/Module/Api/Mastodon/Search.php b/src/Module/Api/Mastodon/Search.php index facaa06eb1..23f920dc3e 100644 --- a/src/Module/Api/Mastodon/Search.php +++ b/src/Module/Api/Mastodon/Search.php @@ -23,7 +23,6 @@ namespace Friendica\Module\Api\Mastodon; use Friendica\Core\Logger; use Friendica\Core\Protocol; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -154,10 +153,9 @@ class Search extends BaseApi substr($q, 1), 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0]; $table = 'tag-search-view'; } else { - $condition = ["`uri-id` IN (SELECT `uri-id` FROM `post-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE)) - AND (`uid` = ? OR (`uid` = ? AND NOT `global`)) AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))", - str_replace('@', ' ', $q), 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0]; - $table = 'post-user-view'; + $q = Post\Engagement::escapeKeywords($q); + $condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) and (private = ? OR `uri-id` in (SELECT `uri-id` FROM `post-user` where `uid` = ?))", $q, Item::PUBLIC, $uid]; + $table = 'post-searchindex'; } if (!empty($max_id)) { diff --git a/src/Module/Conversation/Timeline.php b/src/Module/Conversation/Timeline.php index dd8e885e7c..db801d707b 100644 --- a/src/Module/Conversation/Timeline.php +++ b/src/Module/Conversation/Timeline.php @@ -398,11 +398,7 @@ class Timeline extends BaseModule } if (!empty($channel->fullTextSearch)) { - $search = $channel->fullTextSearch; - foreach (Engagement::KEYWORDS as $keyword) { - $search = preg_replace('~(' . $keyword . ':.[\w@\.-]+)~', '"$1"', $search); - } - $condition = DBA::mergeConditions($condition, ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", $search]); + $condition = DBA::mergeConditions($condition, ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", Engagement::escapeKeywords($channel->fullTextSearch)]); } if (!empty($channel->includeTags)) { diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index b244621fbe..d89c2058bb 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -56,7 +56,7 @@ use Friendica\Database\DBA; // This file is required several times during the test in DbaDefinition which justifies this condition if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1546); + define('DB_UPDATE_VERSION', 1547); } return [ @@ -1480,6 +1480,19 @@ return [ "PRIMARY" => ["uri-id", "id"], ] ], + "post-searchindex" => [ + "comment" => "Content for all posts", + "fields" => [ + "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], + "network" => ["type" => "char(4)", "comment" => ""], + "private" => ["type" => "tinyint unsigned", "comment" => "0=public, 1=private, 2=unlisted"], + "searchtext" => ["type" => "mediumtext", "comment" => "Simplified text for the full text search"], + ], + "indexes" => [ + "PRIMARY" => ["uri-id"], + "searchtext" => ["FULLTEXT", "searchtext"], + ] + ], "post-tag" => [ "comment" => "post relation to tags", "fields" => [ From e9f7ea0afa14e6afcf5f5e61d39b3996a26eb310 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 17 Jan 2024 20:25:49 +0000 Subject: [PATCH 2/6] New search keyword "language" --- doc/Channels.md | 1 + src/Model/Post/Engagement.php | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/Channels.md b/doc/Channels.md index de3f6718d8..5c206c7896 100644 --- a/doc/Channels.md +++ b/doc/Channels.md @@ -80,6 +80,7 @@ Additionally to the search for content, there are additional keywords that can b * visibility:public * visibility:unlisted * visibility:private +* language - Use "language:code" to search for posts with the given language in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. Remember that you can combine these kerywords. So for example you can create a channel with all posts that talk about the Fediverse - that aren't posted in the Fediverse with the search terms: "fediverse -network:apub -network:dfrn" \ No newline at end of file diff --git a/src/Model/Post/Engagement.php b/src/Model/Post/Engagement.php index 5047d71dd2..1d1fa11124 100644 --- a/src/Model/Post/Engagement.php +++ b/src/Model/Post/Engagement.php @@ -24,7 +24,6 @@ namespace Friendica\Model\Post; use Friendica\Content\Text\BBCode; use Friendica\Core\Logger; use Friendica\Core\Protocol; -use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -39,7 +38,7 @@ use Friendica\Util\DateTimeFormat; class Engagement { - const KEYWORDS = ['source', 'server', 'from', 'to', 'group', 'tag', 'network', 'platform', 'visibility']; + const KEYWORDS = ['source', 'server', 'from', 'to', 'group', 'tag', 'network', 'platform', 'visibility', 'language']; /** * Store engagement data from an item array @@ -204,26 +203,26 @@ class Engagement switch ($item['private']) { case Item::PUBLIC: - $body .= ' visibility:public'; + $body .= ' visibility_public'; break; case Item::UNLISTED: - $body .= ' visibility:unlisted'; + $body .= ' visibility_unlisted'; break; case Item::PRIVATE: - $body .= ' visibility:private'; + $body .= ' visibility_private'; break; } if (in_array(Contact::TYPE_COMMUNITY, [$item['author-contact-type'], $item['owner-contact-type']])) { - $body .= ' source:group'; + $body .= ' source_group'; } elseif ($item['author-contact-type'] == Contact::TYPE_PERSON) { - $body .= ' source:person'; + $body .= ' source_person'; } elseif ($item['author-contact-type'] == Contact::TYPE_NEWS) { - $body .= ' source:service'; + $body .= ' source_service'; } elseif ($item['author-contact-type'] == Contact::TYPE_ORGANISATION) { - $body .= ' source:organization'; + $body .= ' source_organization'; } elseif ($item['author-contact-type'] == Contact::TYPE_RELAY) { - $body .= ' source:application'; + $body .= ' source_application'; } if ($item['author-contact-type'] == Contact::TYPE_COMMUNITY) { @@ -257,6 +256,11 @@ class Engagement $body .= ' tag_' . $tag; } + if (!empty($item['language'])) { + $languages = json_decode($item['language'], true); + $body .= ' language_' . array_key_first($languages); + } + $body .= ' ' . $item['title'] . ' ' . $item['content-warning'] . ' ' . $item['body']; return BBCode::toSearchText($body, $item['uri-id']); From 919f97c9a0b3cf6c28b702d748f967d0c0b77df6 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 17 Jan 2024 21:10:33 +0000 Subject: [PATCH 3/6] Postupdate added --- database.sql | 15 +++++++- doc/database.md | 1 + doc/database/db_post-searchindex.md | 31 +++++++++++++++ src/Database/PostUpdate.php | 56 +++++++++++++++++++++++++++- src/Model/Item.php | 13 ++----- src/Model/Post/SearchIndex.php | 58 +++++++++++++++++++++++++++++ 6 files changed, 162 insertions(+), 12 deletions(-) create mode 100644 doc/database/db_post-searchindex.md create mode 100644 src/Model/Post/SearchIndex.php diff --git a/database.sql b/database.sql index 51df6a732c..e3397a44aa 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2024.03-dev (Yellow Archangel) --- DB_UPDATE_VERSION 1546 +-- DB_UPDATE_VERSION 1547 -- ------------------------------------------ @@ -1460,6 +1460,19 @@ CREATE TABLE IF NOT EXISTS `post-question-option` ( FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Question option'; +-- +-- TABLE post-searchindex +-- +CREATE TABLE IF NOT EXISTS `post-searchindex` ( + `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri', + `network` char(4) COMMENT '', + `private` tinyint unsigned COMMENT '0=public, 1=private, 2=unlisted', + `searchtext` mediumtext COMMENT 'Simplified text for the full text search', + PRIMARY KEY(`uri-id`), + FULLTEXT INDEX `searchtext` (`searchtext`), + FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts'; + -- -- TABLE post-tag -- diff --git a/doc/database.md b/doc/database.md index f6b0406956..5942b1144d 100644 --- a/doc/database.md +++ b/doc/database.md @@ -70,6 +70,7 @@ Database Tables | [post-media](help/database/db_post-media) | Attached media | | [post-question](help/database/db_post-question) | Question | | [post-question-option](help/database/db_post-question-option) | Question option | +| [post-searchindex](help/database/db_post-searchindex) | Content for all posts | | [post-tag](help/database/db_post-tag) | post relation to tags | | [post-thread](help/database/db_post-thread) | Thread related data | | [post-thread-user](help/database/db_post-thread-user) | Thread related data per user | diff --git a/doc/database/db_post-searchindex.md b/doc/database/db_post-searchindex.md new file mode 100644 index 0000000000..a5dec8de1b --- /dev/null +++ b/doc/database/db_post-searchindex.md @@ -0,0 +1,31 @@ +Table post-searchindex +=========== + +Content for all posts + +Fields +------ + +| Field | Description | Type | Null | Key | Default | Extra | +| ---------- | --------------------------------------------------------- | ---------------- | ---- | --- | ------- | ----- | +| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | | +| network | | char(4) | YES | | NULL | | +| private | 0=public, 1=private, 2=unlisted | tinyint unsigned | YES | | NULL | | +| searchtext | Simplified text for the full text search | mediumtext | YES | | NULL | | + +Indexes +------------ + +| Name | Fields | +| ---------- | -------------------- | +| PRIMARY | uri-id | +| searchtext | FULLTEXT, searchtext | + +Foreign Keys +------------ + +| Field | Target Table | Target Field | +|-------|--------------|--------------| +| uri-id | [item-uri](help/database/db_item-uri) | id | + +Return to [database documentation](help/database) diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index 1cf8bc1ddb..0a373d88c5 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -52,7 +52,7 @@ class PostUpdate // Needed for the helper function to read from the legacy term table const OBJECT_TYPE_POST = 1; - const VERSION = 1544; + const VERSION = 1547; /** * Calls the post update functions @@ -128,6 +128,9 @@ class PostUpdate if (!self::update1544()) { return false; } + if (!self::update1547()) { + return false; + } return true; } @@ -1358,4 +1361,55 @@ class PostUpdate return false; } + + /** + * Create "post-searchindex" entries for old entries. + * + * @return bool "true" when the job is done + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \ImagickException + */ + private static function update1547() + { + // Was the script completed? + if (DI::keyValue()->get('post_update_version') >= 1547) { + return true; + } + + $id = (int)(DI::keyValue()->get('post_update_version_1547_id') ?? 0); + if ($id == 0) { + $post = Post::selectFirstPost(['uri-id'], [], ['order' => ['uri-id' => true]]); + $id = (int)($post['uri-id'] ?? 0); + } + + Logger::info('Start', ['uri-id' => $id]); + + $rows = 0; + + $posts = Post::selectPosts(['uri-id', 'network', 'private'], ["`uri-id` < ? AND `gravity` IN (?, ?)", $id, Item::GRAVITY_COMMENT, Item::GRAVITY_PARENT], ['order' => ['uri-id' => true], 'limit' => 1000]); + + if (DBA::errorNo() != 0) { + Logger::error('Database error', ['no' => DBA::errorNo(), 'message' => DBA::errorMessage()]); + return false; + } + + while ($post = Post::fetch($posts)) { + $id = $post['uri-id']; + Post\SearchIndex::insert($post['uri-id'], $post['network'], $post['private']); + ++$rows; + } + DBA::close($posts); + + DI::keyValue()->set('post_update_version_1547_id', $id); + + Logger::info('Processed', ['rows' => $rows, 'last' => $id]); + + if ($rows <= 100) { + DI::keyValue()->set('post_update_version', 1547); + Logger::info('Done'); + return true; + } + + return false; + } } diff --git a/src/Model/Item.php b/src/Model/Item.php index d28009a4e6..1637481554 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -247,8 +247,7 @@ class Item $searchtext = Post\Engagement::getSearchTextForUriId($item['uri-id'], true); DBA::update('post-engagement', ['searchtext' => $searchtext], ['uri-id' => $item['uri-id']]); - DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $item['uri-id']]); - + Post\SearchIndex::update($item['uri-id']); } if (!empty($fields['file'])) { @@ -1450,14 +1449,8 @@ class Item $engagement_uri_id = Post\Engagement::storeFromItem($posted_item); - if (in_array($item['gravity'], [self::GRAVITY_PARENT, self::GRAVITY_COMMENT])) { - $search = [ - 'uri-id' => $posted_item['uri-id'], - 'network' => $posted_item['network'], - 'private' => $posted_item['private'], - 'searchtext' => Post\Engagement::getSearchTextForUriId($posted_item['uri-id']), - ]; - DBA::insert('post-searchindex', $search, Database::INSERT_IGNORE); + 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']); } 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 new file mode 100644 index 0000000000..3cc2ae2f38 --- /dev/null +++ b/src/Model/Post/SearchIndex.php @@ -0,0 +1,58 @@ +. + * + */ + +namespace Friendica\Model\Post; + +use Friendica\Database\Database; +use Friendica\Database\DBA; +use Friendica\Model\Post; + +class SearchIndex +{ + /** + * Insert a post-searchindex entry + * + * @param int $uri_id + * @param string $network + * @param int $private + */ + public static function insert(int $uri_id, string $network, int $private) + { + $search = [ + 'uri-id' => $uri_id, + 'network' => $network, + 'private' => $private, + 'searchtext' => Post\Engagement::getSearchTextForUriId($uri_id), + ]; + return DBA::insert('post-searchindex', $search, Database::INSERT_UPDATE); + } + + /** + * update a post-searchindex entry + * + * @param int $uri_id + */ + public static function update(int $uri_id) + { + $searchtext = Post\Engagement::getSearchTextForUriId($uri_id, true); + return DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $uri_id]); + } +} From 6389133575eb3ff3e9e7efb1e82cbc12cf3f0938 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 21 Jan 2024 16:24:59 +0000 Subject: [PATCH 4/6] Expiry post search index entries --- src/Content/Text/BBCode.php | 8 +- src/Database/PostUpdate.php | 11 +- src/Model/Item.php | 2 +- src/Model/Post/Engagement.php | 5 +- src/Model/Post/SearchIndex.php | 34 +- src/Module/Admin/Site.php | 5 +- src/Worker/Cron.php | 2 + src/Worker/ExpireSearchIndex.php | 35 ++ static/dbstructure.config.php | 2 + view/lang/C/messages.po | 590 ++++++++++++----------- view/templates/admin/site.tpl | 1 + view/theme/frio/templates/admin/site.tpl | 1 + 12 files changed, 397 insertions(+), 299 deletions(-) create mode 100644 src/Worker/ExpireSearchIndex.php diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index a824340300..6533c02ae8 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -261,8 +261,12 @@ class BBCode if (!empty($media['description']) && (stripos($text, $media['description']) === false)) { $text .= ' ' . $media['description']; } - if (in_array($media['type'], [Post\Media::HTML, Post\Media::ACTIVITY]) && !empty($media['name']) && (stripos($text, $media['name']) === false)) { - $text .= ' ' . $media['name']; + if (in_array($media['type'], [Post\Media::HTML, Post\Media::ACTIVITY])) { + foreach (['name', 'author-name', 'publisher-name'] as $key) { + if (!empty($media[$key] && stripos($text, $media[$key]) === false)) { + $text .= ' ' . $media[$key]; + } + } } } } diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index 0a373d88c5..09c97708d2 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -1386,7 +1386,14 @@ class PostUpdate $rows = 0; - $posts = Post::selectPosts(['uri-id', 'network', 'private'], ["`uri-id` < ? AND `gravity` IN (?, ?)", $id, Item::GRAVITY_COMMENT, Item::GRAVITY_PARENT], ['order' => ['uri-id' => true], 'limit' => 1000]); + $condition = ["`uri-id` < ? AND `gravity` IN (?, ?)", $id, Item::GRAVITY_COMMENT, Item::GRAVITY_PARENT]; + + $limit = Post\SearchIndex::searchAgeDateLimit(); + if (!empty($limit)) { + DBA::mergeConditions($condition, ["`created` > ?", $limit]); + } + + $posts = Post::selectPosts(['uri-id', 'network', 'private', 'created'], $condition, ['order' => ['uri-id' => true], 'limit' => 1000]); if (DBA::errorNo() != 0) { Logger::error('Database error', ['no' => DBA::errorNo(), 'message' => DBA::errorMessage()]); @@ -1395,7 +1402,7 @@ class PostUpdate while ($post = Post::fetch($posts)) { $id = $post['uri-id']; - Post\SearchIndex::insert($post['uri-id'], $post['network'], $post['private']); + Post\SearchIndex::insert($post['uri-id'], $post['network'], $post['private'], $post['created'], true); ++$rows; } DBA::close($posts); diff --git a/src/Model/Item.php b/src/Model/Item.php index 1637481554..d4983c5069 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1450,7 +1450,7 @@ class Item $engagement_uri_id = Post\Engagement::storeFromItem($posted_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']); + Post\SearchIndex::insert($posted_item['uri-id'], $posted_item['network'], $posted_item['private'], $posted_item['created']); } 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/Engagement.php b/src/Model/Post/Engagement.php index 1d1fa11124..17ccd414e8 100644 --- a/src/Model/Post/Engagement.php +++ b/src/Model/Post/Engagement.php @@ -169,6 +169,9 @@ class Engagement $post = Post::selectFirstPost(['uri-id', 'network', 'title', 'content-warning', 'body', 'private', 'author-id', 'author-contact-type', 'author-nick', 'author-addr', 'author-gsid', 'owner-id', 'owner-contact-type', 'owner-nick', 'owner-addr', 'owner-gsid'], ['uri-id' => $uri_id]); + if (empty($post['uri-id'])) { + return ''; + } return self::getSearchTextForItem($post); } @@ -316,7 +319,7 @@ class Engagement public static function escapeKeywords(string $fullTextSearch): string { foreach (Engagement::KEYWORDS as $keyword) { - $fullTextSearch = preg_replace('~(' . $keyword . '):(.[\w\*@\.-]+)~', '$1_$2', $fullTextSearch); + $fullTextSearch = preg_replace('~(' . $keyword . '):(.[\w\*@\.-]+)~', '"$1_$2"', $fullTextSearch); } return $fullTextSearch; } diff --git a/src/Model/Post/SearchIndex.php b/src/Model/Post/SearchIndex.php index 3cc2ae2f38..ef3a3022f1 100644 --- a/src/Model/Post/SearchIndex.php +++ b/src/Model/Post/SearchIndex.php @@ -21,9 +21,12 @@ namespace Friendica\Model\Post; +use Friendica\Core\Logger; use Friendica\Database\Database; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Post; +use Friendica\Util\DateTimeFormat; class SearchIndex { @@ -33,14 +36,22 @@ class SearchIndex * @param int $uri_id * @param string $network * @param int $private + * @param string $created + * @param bool $refresh */ - public static function insert(int $uri_id, string $network, int $private) + public static function insert(int $uri_id, string $network, int $private, string $created, bool $refresh = false) { + $limit = self::searchAgeDateLimit(); + if (!empty($limit) && (strtotime($created) < strtotime($limit))) { + return; + } + $search = [ 'uri-id' => $uri_id, 'network' => $network, 'private' => $private, - 'searchtext' => Post\Engagement::getSearchTextForUriId($uri_id), + 'created' => $created, + 'searchtext' => Post\Engagement::getSearchTextForUriId($uri_id, $refresh), ]; return DBA::insert('post-searchindex', $search, Database::INSERT_UPDATE); } @@ -55,4 +66,23 @@ class SearchIndex $searchtext = Post\Engagement::getSearchTextForUriId($uri_id, true); return DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $uri_id]); } + + public static function expire() + { + $limit = self::searchAgeDateLimit(); + if (empty($limit)) { + return; + } + DBA::delete('post-searchindex', ["`created` < ?", $limit]); + Logger::notice('Cleared expired searchindex entries', ['limit' => $limit, 'rows' => DBA::affectedRows()]); + } + + public static function searchAgeDateLimit(): string + { + $days = DI::config()->get('system', 'search_age_days'); + if (empty($days)) { + return ''; + } + return DateTimeFormat::utc('now - ' . $days . ' day'); + } } diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index d4d07b25bc..2930a3521a 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -140,6 +140,7 @@ class Site extends BaseAdmin $temppath = (!empty($_POST['temppath']) ? trim($_POST['temppath']) : ''); $singleuser = (!empty($_POST['singleuser']) ? trim($_POST['singleuser']) : ''); $only_tag_search = !empty($_POST['only_tag_search']); + $search_age_days = (!empty($_POST['search_age_days']) ? intval($_POST['search_age_days']) : 0); $compute_circle_counts = !empty($_POST['compute_circle_counts']); $process_view = !empty($_POST['process_view']); $archival_days = (!empty($_POST['archival_days']) ? intval($_POST['archival_days']) : 0); @@ -314,7 +315,8 @@ class Site extends BaseAdmin $transactionConfig->set('system', 'temppath', $temppath); - $transactionConfig->set('system', 'only_tag_search' , $only_tag_search); + $transactionConfig->set('system', 'only_tag_search', $only_tag_search); + $transactionConfig->set('system', 'search_age_days', $search_age_days); $transactionConfig->set('system', 'compute_circle_counts', $compute_circle_counts); $transactionConfig->set('system', 'process_view', $process_view); $transactionConfig->set('system', 'archival_days', $archival_days); @@ -567,6 +569,7 @@ class Site extends BaseAdmin '$itemspage_network_mobile' => ['itemspage_network_mobile', DI::l10n()->t('Items per page for mobile devices'), DI::config()->get('system', 'itemspage_network_mobile'), DI::l10n()->t('Number of items per page in stream pages (network, community, profile/contact statuses, search) for mobile devices.')], '$temppath' => ['temppath', DI::l10n()->t('Temp path'), DI::config()->get('system', 'temppath'), DI::l10n()->t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')], '$only_tag_search' => ['only_tag_search', DI::l10n()->t('Only search in tags'), DI::config()->get('system', 'only_tag_search'), DI::l10n()->t('On large systems the text search can slow down the system extremely.')], + '$search_age_days' => ['search_age_days', DI::l10n()->t('Maximum age of items in the search table'), DI::config()->get('system', 'search_age_days'), DI::l10n()->t('Maximum age of items in the search table in days. Lower values will increase the performance and reduce disk usage. 0 means no age restriction.')], '$compute_circle_counts' => ['compute_circle_counts', DI::l10n()->t('Generate counts per contact circle when calculating network count'), DI::config()->get('system', 'compute_circle_counts'), DI::l10n()->t('On systems with users that heavily use contact circles the query can be very expensive.')], '$process_view' => ['process_view', DI::l10n()->t('Process "view" activities'), DI::config()->get('system', 'process_view'), DI::l10n()->t('"view" activities are mostly geberated by Peertube systems. Per default they are not processed for performance reasons. Only activate this option on performant system.')], '$archival_days' => ['archival_days', DI::l10n()->t('Days, after which a contact is archived'), DI::config()->get('system', 'archival_days'), DI::l10n()->t('Number of days that we try to deliver content or to update the contact data before we archive a contact.')], diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index 06e59ec97c..e9f7ceab69 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -123,6 +123,8 @@ class Cron Worker::add(Worker::PRIORITY_LOW, 'ExpireActivities'); + Worker::add(Worker::PRIORITY_LOW, 'ExpireSearchIndex'); + Worker::add(Worker::PRIORITY_LOW, 'RemoveUnusedTags'); Worker::add(Worker::PRIORITY_LOW, 'RemoveUnusedContacts'); diff --git a/src/Worker/ExpireSearchIndex.php b/src/Worker/ExpireSearchIndex.php new file mode 100644 index 0000000000..6a3977e69d --- /dev/null +++ b/src/Worker/ExpireSearchIndex.php @@ -0,0 +1,35 @@ +. + * + */ + +namespace Friendica\Worker; + +use Friendica\Model\Post; + +/** + * Expire old search index entries + */ +class ExpireSearchIndex +{ + public static function execute($param = '', $hook_function = '') + { + Post\SearchIndex::expire(); + } +} diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index d89c2058bb..23c255395f 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1487,9 +1487,11 @@ return [ "network" => ["type" => "char(4)", "comment" => ""], "private" => ["type" => "tinyint unsigned", "comment" => "0=public, 1=private, 2=unlisted"], "searchtext" => ["type" => "mediumtext", "comment" => "Simplified text for the full text search"], + "created" => ["type" => "datetime", "comment" => ""], ], "indexes" => [ "PRIMARY" => ["uri-id"], + "created" => ["created"], "searchtext" => ["FULLTEXT", "searchtext"], ] ], diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 2815e0948f..05d1b4c1af 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2024.03-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-15 19:41+0000\n" +"POT-Creation-Date: 2024-01-20 14:09+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -380,7 +380,7 @@ msgstr "" msgid "Personal notes are visible only by yourself." msgstr "" -#: mod/notes.php:57 src/Content/Text/HTML.php:859 +#: mod/notes.php:57 src/Content/Text/HTML.php:860 #: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:74 #: src/Module/Post/Edit.php:129 src/Module/Settings/Channels.php:212 msgid "Save" @@ -1748,7 +1748,7 @@ msgid "" msgstr "" #: src/Content/GroupManager.php:147 src/Content/Nav.php:278 -#: src/Content/Text/HTML.php:880 src/Content/Widget.php:537 +#: src/Content/Text/HTML.php:881 src/Content/Widget.php:537 #: src/Model/User.php:1378 msgid "Groups" msgstr "" @@ -1770,7 +1770,7 @@ msgstr "" msgid "Create new group" msgstr "" -#: src/Content/Item.php:332 src/Model/Item.php:3235 +#: src/Content/Item.php:332 src/Model/Item.php:3244 msgid "event" msgstr "" @@ -1778,7 +1778,7 @@ msgstr "" msgid "status" msgstr "" -#: src/Content/Item.php:341 src/Model/Item.php:3237 +#: src/Content/Item.php:341 src/Model/Item.php:3246 #: src/Module/Post/Tag/Add.php:123 msgid "photo" msgstr "" @@ -1873,7 +1873,7 @@ msgstr "" msgid "Clear notifications" msgstr "" -#: src/Content/Nav.php:127 src/Content/Text/HTML.php:867 +#: src/Content/Nav.php:127 src/Content/Text/HTML.php:868 msgid "@name, !group, #tags, content" msgstr "" @@ -1990,7 +1990,7 @@ msgstr "" msgid "Addon applications, utilities, games" msgstr "" -#: src/Content/Nav.php:269 src/Content/Text/HTML.php:865 +#: src/Content/Nav.php:269 src/Content/Text/HTML.php:866 #: src/Module/Admin/Logs/View.php:86 src/Module/Search/Index.php:112 msgid "Search" msgstr "" @@ -1999,17 +1999,17 @@ msgstr "" msgid "Search site content" msgstr "" -#: src/Content/Nav.php:272 src/Content/Text/HTML.php:874 +#: src/Content/Nav.php:272 src/Content/Text/HTML.php:875 msgid "Full Text" msgstr "" -#: src/Content/Nav.php:273 src/Content/Text/HTML.php:875 +#: src/Content/Nav.php:273 src/Content/Text/HTML.php:876 #: src/Content/Widget/TagCloud.php:68 msgid "Tags" msgstr "" #: src/Content/Nav.php:274 src/Content/Nav.php:329 -#: src/Content/Text/HTML.php:876 src/Module/BaseProfile.php:127 +#: src/Content/Text/HTML.php:877 src/Module/BaseProfile.php:127 #: src/Module/BaseProfile.php:130 src/Module/Contact.php:426 #: src/Module/Contact.php:535 view/theme/frio/theme.php:243 msgid "Contacts" @@ -2180,51 +2180,51 @@ msgstr "" msgid "last" msgstr "" -#: src/Content/Text/BBCode.php:755 src/Content/Text/BBCode.php:1700 -#: src/Content/Text/BBCode.php:1701 +#: src/Content/Text/BBCode.php:762 src/Content/Text/BBCode.php:1707 +#: src/Content/Text/BBCode.php:1708 msgid "Image/photo" msgstr "" -#: src/Content/Text/BBCode.php:973 +#: src/Content/Text/BBCode.php:980 #, php-format msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:998 src/Model/Item.php:3968 -#: src/Model/Item.php:3974 src/Model/Item.php:3975 +#: src/Content/Text/BBCode.php:1005 src/Model/Item.php:3977 +#: src/Model/Item.php:3983 src/Model/Item.php:3984 msgid "Link to source" msgstr "" -#: src/Content/Text/BBCode.php:1607 src/Content/Text/HTML.php:904 +#: src/Content/Text/BBCode.php:1614 src/Content/Text/HTML.php:905 msgid "Click to open/close" msgstr "" -#: src/Content/Text/BBCode.php:1640 +#: src/Content/Text/BBCode.php:1647 msgid "$1 wrote:" msgstr "" -#: src/Content/Text/BBCode.php:1705 src/Content/Text/BBCode.php:1706 +#: src/Content/Text/BBCode.php:1712 src/Content/Text/BBCode.php:1713 msgid "Encrypted content" msgstr "" -#: src/Content/Text/BBCode.php:1961 +#: src/Content/Text/BBCode.php:1968 msgid "Invalid source protocol" msgstr "" -#: src/Content/Text/BBCode.php:1980 +#: src/Content/Text/BBCode.php:1987 msgid "Invalid link protocol" msgstr "" -#: src/Content/Text/HTML.php:782 +#: src/Content/Text/HTML.php:783 msgid "Loading more entries..." msgstr "" -#: src/Content/Text/HTML.php:783 +#: src/Content/Text/HTML.php:784 msgid "The end" msgstr "" -#: src/Content/Text/HTML.php:859 src/Content/Widget/VCard.php:123 +#: src/Content/Text/HTML.php:860 src/Content/Widget/VCard.php:123 #: src/Model/Profile.php:477 src/Module/Contact/Profile.php:471 msgid "Follow" msgstr "" @@ -2372,7 +2372,7 @@ msgstr "" msgid "All" msgstr "" -#: src/Content/Widget.php:591 src/Module/Admin/Site.php:468 +#: src/Content/Widget.php:591 src/Module/Admin/Site.php:470 #: src/Module/BaseSettings.php:125 src/Module/Settings/Channels.php:208 #: src/Module/Settings/Display.php:315 msgid "Channels" @@ -2855,7 +2855,7 @@ msgstr "" msgid "Could not connect to database." msgstr "" -#: src/Core/L10n.php:444 src/Model/Item.php:2279 +#: src/Core/L10n.php:444 src/Model/Item.php:2288 msgid "Undetermined" msgstr "" @@ -3413,91 +3413,91 @@ msgstr "" msgid "Happy Birthday %s" msgstr "" -#: src/Model/Item.php:2286 +#: src/Model/Item.php:2295 #, php-format msgid "%s (%s - %s): %s" msgstr "" -#: src/Model/Item.php:2288 +#: src/Model/Item.php:2297 #, php-format msgid "%s (%s): %s" msgstr "" -#: src/Model/Item.php:2291 +#: src/Model/Item.php:2300 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "" -#: src/Model/Item.php:3239 +#: src/Model/Item.php:3248 msgid "activity" msgstr "" -#: src/Model/Item.php:3241 +#: src/Model/Item.php:3250 msgid "comment" msgstr "" -#: src/Model/Item.php:3244 src/Module/Post/Tag/Add.php:123 +#: src/Model/Item.php:3253 src/Module/Post/Tag/Add.php:123 msgid "post" msgstr "" -#: src/Model/Item.php:3414 +#: src/Model/Item.php:3423 #, php-format msgid "%s is blocked" msgstr "" -#: src/Model/Item.php:3416 +#: src/Model/Item.php:3425 #, php-format msgid "%s is ignored" msgstr "" -#: src/Model/Item.php:3418 +#: src/Model/Item.php:3427 #, php-format msgid "Content from %s is collapsed" msgstr "" -#: src/Model/Item.php:3422 +#: src/Model/Item.php:3431 #, php-format msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3875 +#: src/Model/Item.php:3884 msgid "bytes" msgstr "" -#: src/Model/Item.php:3906 +#: src/Model/Item.php:3915 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3908 +#: src/Model/Item.php:3917 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3913 +#: src/Model/Item.php:3922 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3915 +#: src/Model/Item.php:3924 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3917 +#: src/Model/Item.php:3926 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:3951 src/Model/Item.php:3952 +#: src/Model/Item.php:3960 src/Model/Item.php:3961 msgid "View on separate page" msgstr "" @@ -3942,7 +3942,7 @@ msgstr "" #: src/Module/Admin/Addons/Details.php:111 src/Module/Admin/Addons/Index.php:67 #: src/Module/Admin/Federation.php:218 src/Module/Admin/Logs/Settings.php:85 #: src/Module/Admin/Logs/View.php:83 src/Module/Admin/Queue.php:72 -#: src/Module/Admin/Site.php:451 src/Module/Admin/Storage.php:138 +#: src/Module/Admin/Site.php:453 src/Module/Admin/Storage.php:138 #: src/Module/Admin/Summary.php:196 src/Module/Admin/Themes/Details.php:90 #: src/Module/Admin/Themes/Index.php:111 src/Module/Admin/Tos.php:77 #: src/Module/Moderation/Users/Create.php:61 @@ -3980,7 +3980,7 @@ msgid "Addon %s failed to install." msgstr "" #: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:86 -#: src/Module/Admin/Logs/Settings.php:87 src/Module/Admin/Site.php:454 +#: src/Module/Admin/Logs/Settings.php:87 src/Module/Admin/Site.php:456 #: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:86 #: src/Module/Settings/Account.php:551 src/Module/Settings/Addons.php:78 #: src/Module/Settings/Connectors.php:160 @@ -4180,8 +4180,8 @@ msgid "Enable Debugging" msgstr "" #: src/Module/Admin/Logs/Settings.php:91 src/Module/Admin/Logs/Settings.php:92 -#: src/Module/Admin/Logs/Settings.php:93 src/Module/Admin/Site.php:474 -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Logs/Settings.php:93 src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:484 msgid "Read-only because it is set by an environment variable" msgstr "" @@ -4341,269 +4341,269 @@ msgstr "" msgid "Priority" msgstr "" -#: src/Module/Admin/Site.php:241 +#: src/Module/Admin/Site.php:242 #, php-format msgid "%s is no valid input for maximum image size" msgstr "" -#: src/Module/Admin/Site.php:366 src/Module/Settings/Display.php:215 +#: src/Module/Admin/Site.php:368 src/Module/Settings/Display.php:215 msgid "No special theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:383 src/Module/Settings/Display.php:225 +#: src/Module/Admin/Site.php:385 src/Module/Settings/Display.php:225 #, php-format msgid "%s - (Experimental)" msgstr "" -#: src/Module/Admin/Site.php:395 +#: src/Module/Admin/Site.php:397 msgid "No community page" msgstr "" -#: src/Module/Admin/Site.php:396 +#: src/Module/Admin/Site.php:398 msgid "No community page for visitors" msgstr "" -#: src/Module/Admin/Site.php:397 +#: src/Module/Admin/Site.php:399 msgid "Public postings from users of this site" msgstr "" -#: src/Module/Admin/Site.php:398 +#: src/Module/Admin/Site.php:400 msgid "Public postings from the federated network" msgstr "" -#: src/Module/Admin/Site.php:399 +#: src/Module/Admin/Site.php:401 msgid "Public postings from local users and the federated network" msgstr "" -#: src/Module/Admin/Site.php:405 +#: src/Module/Admin/Site.php:407 msgid "Multi user instance" msgstr "" -#: src/Module/Admin/Site.php:428 +#: src/Module/Admin/Site.php:430 msgid "Closed" msgstr "" -#: src/Module/Admin/Site.php:429 +#: src/Module/Admin/Site.php:431 msgid "Requires approval" msgstr "" -#: src/Module/Admin/Site.php:430 +#: src/Module/Admin/Site.php:432 msgid "Open" msgstr "" -#: src/Module/Admin/Site.php:434 +#: src/Module/Admin/Site.php:436 msgid "Don't check" msgstr "" -#: src/Module/Admin/Site.php:435 +#: src/Module/Admin/Site.php:437 msgid "check the stable version" msgstr "" -#: src/Module/Admin/Site.php:436 +#: src/Module/Admin/Site.php:438 msgid "check the development version" msgstr "" -#: src/Module/Admin/Site.php:440 +#: src/Module/Admin/Site.php:442 msgid "none" msgstr "" -#: src/Module/Admin/Site.php:441 +#: src/Module/Admin/Site.php:443 msgid "Local contacts" msgstr "" -#: src/Module/Admin/Site.php:442 +#: src/Module/Admin/Site.php:444 msgid "Interactors" msgstr "" -#: src/Module/Admin/Site.php:452 src/Module/BaseAdmin.php:90 +#: src/Module/Admin/Site.php:454 src/Module/BaseAdmin.php:90 msgid "Site" msgstr "" -#: src/Module/Admin/Site.php:453 +#: src/Module/Admin/Site.php:455 msgid "General Information" msgstr "" -#: src/Module/Admin/Site.php:455 +#: src/Module/Admin/Site.php:457 msgid "Republish users to directory" msgstr "" -#: src/Module/Admin/Site.php:456 src/Module/Register.php:152 +#: src/Module/Admin/Site.php:458 src/Module/Register.php:152 msgid "Registration" msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:459 msgid "File upload" msgstr "" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:460 msgid "Policies" msgstr "" -#: src/Module/Admin/Site.php:459 src/Module/Calendar/Event/Form.php:252 +#: src/Module/Admin/Site.php:461 src/Module/Calendar/Event/Form.php:252 #: src/Module/Contact.php:546 src/Module/Profile/Profile.php:276 msgid "Advanced" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:462 msgid "Auto Discovered Contact Directory" msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:463 msgid "Performance" msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:464 msgid "Worker" msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:465 msgid "Message Relay" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:466 msgid "" "Use the command \"console relay\" in the command line to add or remove " "relays." msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:467 msgid "The system is not subscribed to any relays at the moment." msgstr "" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:468 msgid "The system is currently subscribed to the following relays:" msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:471 msgid "Relocate Node" msgstr "" -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:472 msgid "" "Relocating your node enables you to change the DNS domain of this node and " "keep all the existing users and posts. This process takes a while and can " "only be started from the relocate console command like this:" msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:473 msgid "(Friendica directory)# bin/console relocate https://newdomain.com" msgstr "" -#: src/Module/Admin/Site.php:474 +#: src/Module/Admin/Site.php:476 msgid "Site name" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:477 msgid "Sender Email" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:477 msgid "" "The email address your server shall use to send notification emails from." msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:478 msgid "Name of the system actor" msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:478 msgid "" "Name of the internal system account that is used to perform ActivityPub " "requests. This must be an unused username. If set, this can't be changed " "again." msgstr "" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:479 msgid "Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:480 msgid "Email Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:481 msgid "Shortcut icon" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:481 msgid "Link to an icon that will be used for browsers." msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:482 msgid "Touch icon" msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:482 msgid "Link to an icon that will be used for tablets and mobiles." msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:483 msgid "Additional Info" msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:483 #, php-format msgid "" "For public servers: you can add additional information here that will be " "listed at %s/servers." msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:484 msgid "System language" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:485 msgid "System theme" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:485 #, php-format msgid "" "Default system theme - may be over-ridden by user profiles - Change default theme settings" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:486 msgid "Mobile system theme" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:486 msgid "Theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:487 msgid "Force SSL" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:487 msgid "" "Force all Non-SSL requests to SSL - Attention: on some systems it could lead " "to endless loops." msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:488 msgid "Show help entry from navigation menu" msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:488 msgid "" "Displays the menu entry for the Help pages from the navigation menu. It is " "always accessible by calling /help directly." msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:489 msgid "Single user instance" msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:489 msgid "Make this instance multi-user or single-user for the named user" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:491 msgid "Maximum image size" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:491 #, php-format msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " @@ -4615,35 +4615,35 @@ msgid "" "to %s (%s byte)" msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:495 msgid "Maximum image length" msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:495 msgid "" "Maximum length in pixels of the longest side of uploaded images. Default is " "-1, which means no limits." msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:496 msgid "JPEG image quality" msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:496 msgid "" "Uploaded JPEGS will be saved at this quality setting [0-100]. Default is " "100, which is full quality." msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:498 msgid "Register policy" msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:499 msgid "Maximum Users" msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:499 msgid "" "If defined, the register policy is automatically closed when the given " "number of users is reached and reopens the registry when the number drops " @@ -4651,168 +4651,168 @@ msgid "" "not when the policy is set to approval." msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:500 msgid "Maximum Daily Registrations" msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:500 msgid "" "If registration is permitted above, this sets the maximum number of new user " "registrations to accept per day. If register is set to closed, this setting " "has no effect." msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:501 msgid "Register text" msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:501 msgid "" "Will be displayed prominently on the registration page. You can use BBCode " "here." msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:502 msgid "Forbidden Nicknames" msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:502 msgid "" "Comma separated list of nicknames that are forbidden from registration. " "Preset is a list of role names according RFC 2142." msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:503 msgid "Accounts abandoned after x days" msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:503 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:504 msgid "Allowed friend domains" msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:504 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:505 msgid "Allowed email domains" msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:505 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "" -#: src/Module/Admin/Site.php:504 +#: src/Module/Admin/Site.php:506 msgid "No OEmbed rich content" msgstr "" -#: src/Module/Admin/Site.php:504 +#: src/Module/Admin/Site.php:506 msgid "" "Don't show the rich content (e.g. embedded PDF), except from the domains " "listed below." msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:507 msgid "Trusted third-party domains" msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:507 msgid "" "Comma separated list of domains from which content is allowed to be embedded " "in posts like with OEmbed. All sub-domains of the listed domains are allowed " "as well." msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:508 msgid "Block public" msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:508 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:509 msgid "Force publish" msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:509 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:509 msgid "Enabling this may violate privacy laws like the GDPR" msgstr "" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:510 msgid "Global directory URL" msgstr "" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:510 msgid "" "URL to the global directory. If this is not set, the global directory is " "completely unavailable to the application." msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:511 msgid "Private posts by default for new users" msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:511 msgid "" "Set default post permissions for all new members to the default privacy " "circle rather than public." msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:512 msgid "Don't include post content in email notifications" msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:512 msgid "" "Don't include the content of a post/comment/private message/etc. in the " "email notifications that are sent out from this site, as a privacy measure." msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:513 msgid "Disallow public access to addons listed in the apps menu." msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:513 msgid "" "Checking this box will restrict addons listed in the apps menu to members " "only." msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:514 msgid "Don't embed private images in posts" msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:514 msgid "" "Don't replace locally-hosted private photos in posts with an embedded copy " "of the image. This means that contacts who receive posts containing private " "photos will have to authenticate and load each image, which may take a while." msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:515 msgid "Explicit Content" msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:515 msgid "" "Set this to announce that your node is used mostly for explicit content that " "might not be suited for minors. This information will be published in the " @@ -4821,339 +4821,339 @@ msgid "" "will be shown at the user registration page." msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:516 msgid "Proxify external content" msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:516 msgid "" "Route external content via the proxy functionality. This is used for example " "for some OEmbed accesses and in some other rare cases." msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:517 msgid "Only local search" msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:517 msgid "" "Blocks search for users who are not logged in to prevent crawlers from " "blocking your system." msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:518 msgid "Blocked tags for trending tags" msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:518 msgid "" "Comma separated list of hashtags that shouldn't be displayed in the trending " "tags." msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:519 msgid "Cache contact avatars" msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:519 msgid "" "Locally store the avatar pictures of the contacts. This uses a lot of " "storage space but it increases the performance." msgstr "" -#: src/Module/Admin/Site.php:518 +#: src/Module/Admin/Site.php:520 msgid "Allow Users to set remote_self" msgstr "" -#: src/Module/Admin/Site.php:518 +#: src/Module/Admin/Site.php:520 msgid "" "With checking this, every user is allowed to mark every contact as a " "remote_self in the repair contact dialog. Setting this flag on a contact " "causes mirroring every posting of that contact in the users stream." msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:521 msgid "Allow Users to set up relay channels" msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:521 msgid "" "If enabled, it is possible to create relay users that are used to reshare " "content based on user defined channels." msgstr "" -#: src/Module/Admin/Site.php:520 +#: src/Module/Admin/Site.php:522 msgid "Adjust the feed poll frequency" msgstr "" -#: src/Module/Admin/Site.php:520 +#: src/Module/Admin/Site.php:522 msgid "Automatically detect and set the best feed poll frequency." msgstr "" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:523 msgid "Minimum poll interval" msgstr "" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:523 msgid "" "Minimal distance in minutes between two polls for mail and feed contacts. " "Reasonable values are between 1 and 59." msgstr "" -#: src/Module/Admin/Site.php:522 +#: src/Module/Admin/Site.php:524 msgid "Enable multiple registrations" msgstr "" -#: src/Module/Admin/Site.php:522 +#: src/Module/Admin/Site.php:524 msgid "Enable users to register additional accounts for use as pages." msgstr "" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:525 msgid "Enable OpenID" msgstr "" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:525 msgid "Enable OpenID support for registration and logins." msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:526 msgid "Enable full name check" msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:526 msgid "" "Prevents users from registering with a display name with fewer than two " "parts separated by spaces." msgstr "" -#: src/Module/Admin/Site.php:525 +#: src/Module/Admin/Site.php:527 msgid "Email administrators on new registration" msgstr "" -#: src/Module/Admin/Site.php:525 +#: src/Module/Admin/Site.php:527 msgid "" "If enabled and the system is set to an open registration, an email for each " "new registration is sent to the administrators." msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:528 msgid "Community pages for visitors" msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:528 msgid "" "Which community pages should be available for visitors. Local users always " "see both pages." msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:529 msgid "Posts per user on community page" msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:529 msgid "" "The maximum number of posts per user on the local community page. This is " "useful, when a single user floods the local community page." msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:530 msgid "Posts per server on community page" msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:530 msgid "" "The maximum number of posts per server on the global community page. This is " "useful, when posts from a single server flood the global community page." msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:532 msgid "Enable Mail support" msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:532 msgid "" "Enable built-in mail support to poll IMAP folders and to reply via mail." msgstr "" -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:533 msgid "" "Mail support can't be enabled because the PHP IMAP module is not installed." msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:534 msgid "Enable OStatus support" msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:534 msgid "" "Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All " "communications in OStatus are public." msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:536 msgid "" "Diaspora support can't be enabled because Friendica was installed into a sub " "directory." msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:537 msgid "Enable Diaspora support" msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:537 msgid "" "Enable built-in Diaspora network compatibility for communicating with " "diaspora servers." msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:538 msgid "Verify SSL" msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:538 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you " "cannot connect (at all) to self-signed SSL sites." msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:539 msgid "Proxy user" msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:539 msgid "User name for the proxy server." msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:540 msgid "Proxy URL" msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:540 msgid "" "If you want to use a proxy server that Friendica should use to connect to " "the network, put the URL of the proxy here." msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:541 msgid "Network timeout" msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:541 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:542 msgid "Maximum Load Average" msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:542 #, php-format msgid "" "Maximum system load before delivery and poll processes are deferred - " "default %d." msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:543 msgid "Minimal Memory" msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:543 msgid "" "Minimal free memory in MB for the worker. Needs access to /proc/meminfo - " "default 0 (deactivated)." msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:544 msgid "Periodically optimize tables" msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:544 msgid "Periodically optimize tables like the cache and the workerqueue" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:546 msgid "Discover followers/followings from contacts" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:546 msgid "" "If enabled, contacts are checked for their followers and following contacts." msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:547 msgid "None - deactivated" msgstr "" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:548 msgid "" "Local contacts - contacts of our local contacts are discovered for their " "followers/followings." msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:549 msgid "" "Interactors - contacts of our local contacts and contacts who interacted on " "locally visible postings are discovered for their followers/followings." msgstr "" -#: src/Module/Admin/Site.php:549 +#: src/Module/Admin/Site.php:551 msgid "Only update contacts/servers with local data" msgstr "" -#: src/Module/Admin/Site.php:549 +#: src/Module/Admin/Site.php:551 msgid "" "If enabled, the system will only look for changes in contacts and servers " "that engaged on this system by either being in a contact list of a user or " "when posts or comments exists from the contact on this system." msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:552 msgid "Synchronize the contacts with the directory server" msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:552 msgid "" "if enabled, the system will check periodically for new contacts on the " "defined directory server." msgstr "" -#: src/Module/Admin/Site.php:552 +#: src/Module/Admin/Site.php:554 msgid "Discover contacts from other servers" msgstr "" -#: src/Module/Admin/Site.php:552 +#: src/Module/Admin/Site.php:554 msgid "" "Periodically query other servers for contacts and servers that they know of. " "The system queries Friendica, Mastodon and Hubzilla servers. Keep it " "deactivated on small machines to decrease the database size and load." msgstr "" -#: src/Module/Admin/Site.php:553 +#: src/Module/Admin/Site.php:555 msgid "Days between requery" msgstr "" -#: src/Module/Admin/Site.php:553 +#: src/Module/Admin/Site.php:555 msgid "" "Number of days after which a server is requeried for their contacts and " "servers it knows of. This is only used when the discovery is activated." msgstr "" -#: src/Module/Admin/Site.php:554 +#: src/Module/Admin/Site.php:556 msgid "Search the local directory" msgstr "" -#: src/Module/Admin/Site.php:554 +#: src/Module/Admin/Site.php:556 msgid "" "Search the local directory instead of the global directory. When searching " "locally, every search will be executed on the global directory in the " "background. This improves the search results when the search is repeated." msgstr "" -#: src/Module/Admin/Site.php:556 +#: src/Module/Admin/Site.php:558 msgid "Publish server information" msgstr "" -#: src/Module/Admin/Site.php:556 +#: src/Module/Admin/Site.php:558 msgid "" "If enabled, general server and usage data will be published. The data " "contains the name and version of the server, number of users with public " @@ -5161,50 +5161,50 @@ msgid "" "href=\"http://the-federation.info/\">the-federation.info for details." msgstr "" -#: src/Module/Admin/Site.php:558 +#: src/Module/Admin/Site.php:560 msgid "Check upstream version" msgstr "" -#: src/Module/Admin/Site.php:558 +#: src/Module/Admin/Site.php:560 msgid "" "Enables checking for new Friendica versions at github. If there is a new " "version, you will be informed in the admin panel overview." msgstr "" -#: src/Module/Admin/Site.php:559 +#: src/Module/Admin/Site.php:561 msgid "Suppress Tags" msgstr "" -#: src/Module/Admin/Site.php:559 +#: src/Module/Admin/Site.php:561 msgid "Suppress showing a list of hashtags at the end of the posting." msgstr "" -#: src/Module/Admin/Site.php:560 +#: src/Module/Admin/Site.php:562 msgid "Clean database" msgstr "" -#: src/Module/Admin/Site.php:560 +#: src/Module/Admin/Site.php:562 msgid "" "Remove old remote items, orphaned database records and old content from some " "other helper tables." msgstr "" -#: src/Module/Admin/Site.php:561 +#: src/Module/Admin/Site.php:563 msgid "Lifespan of remote items" msgstr "" -#: src/Module/Admin/Site.php:561 +#: src/Module/Admin/Site.php:563 msgid "" "When the database cleanup is enabled, this defines the days after which " "remote items will be deleted. Own items, and marked or filed items are " "always kept. 0 disables this behaviour." msgstr "" -#: src/Module/Admin/Site.php:562 +#: src/Module/Admin/Site.php:564 msgid "Lifespan of unclaimed items" msgstr "" -#: src/Module/Admin/Site.php:562 +#: src/Module/Admin/Site.php:564 msgid "" "When the database cleanup is enabled, this defines the days after which " "unclaimed remote items (mostly content from the relay) will be deleted. " @@ -5212,165 +5212,175 @@ msgid "" "items if set to 0." msgstr "" -#: src/Module/Admin/Site.php:563 +#: src/Module/Admin/Site.php:565 msgid "Lifespan of raw conversation data" msgstr "" -#: src/Module/Admin/Site.php:563 +#: src/Module/Admin/Site.php:565 msgid "" "The conversation data is used for ActivityPub and OStatus, as well as for " "debug purposes. It should be safe to remove it after 14 days, default is 90 " "days." msgstr "" -#: src/Module/Admin/Site.php:564 +#: src/Module/Admin/Site.php:566 msgid "Maximum numbers of comments per post" msgstr "" -#: src/Module/Admin/Site.php:564 +#: src/Module/Admin/Site.php:566 msgid "How much comments should be shown for each post? Default value is 100." msgstr "" -#: src/Module/Admin/Site.php:565 +#: src/Module/Admin/Site.php:567 msgid "Maximum numbers of comments per post on the display page" msgstr "" -#: src/Module/Admin/Site.php:565 +#: src/Module/Admin/Site.php:567 msgid "" "How many comments should be shown on the single view for each post? Default " "value is 1000." msgstr "" -#: src/Module/Admin/Site.php:566 +#: src/Module/Admin/Site.php:568 msgid "Items per page" msgstr "" -#: src/Module/Admin/Site.php:566 +#: src/Module/Admin/Site.php:568 msgid "" "Number of items per page in stream pages (network, community, profile/" "contact statuses, search)." msgstr "" -#: src/Module/Admin/Site.php:567 +#: src/Module/Admin/Site.php:569 msgid "Items per page for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:567 +#: src/Module/Admin/Site.php:569 msgid "" "Number of items per page in stream pages (network, community, profile/" "contact statuses, search) for mobile devices." msgstr "" -#: src/Module/Admin/Site.php:568 +#: src/Module/Admin/Site.php:570 msgid "Temp path" msgstr "" -#: src/Module/Admin/Site.php:568 +#: src/Module/Admin/Site.php:570 msgid "" "If you have a restricted system where the webserver can't access the system " "temp path, enter another path here." msgstr "" -#: src/Module/Admin/Site.php:569 +#: src/Module/Admin/Site.php:571 msgid "Only search in tags" msgstr "" -#: src/Module/Admin/Site.php:569 +#: src/Module/Admin/Site.php:571 msgid "On large systems the text search can slow down the system extremely." msgstr "" -#: src/Module/Admin/Site.php:570 +#: src/Module/Admin/Site.php:572 +msgid "Maximum age of items in the search table" +msgstr "" + +#: src/Module/Admin/Site.php:572 +msgid "" +"Maximum age of items in the search table in days. Lower values will increase " +"the performance and reduce disk usage. 0 means no age restriction." +msgstr "" + +#: src/Module/Admin/Site.php:573 msgid "Generate counts per contact circle when calculating network count" msgstr "" -#: src/Module/Admin/Site.php:570 +#: src/Module/Admin/Site.php:573 msgid "" "On systems with users that heavily use contact circles the query can be very " "expensive." msgstr "" -#: src/Module/Admin/Site.php:571 +#: src/Module/Admin/Site.php:574 msgid "Process \"view\" activities" msgstr "" -#: src/Module/Admin/Site.php:571 +#: src/Module/Admin/Site.php:574 msgid "" "\"view\" activities are mostly geberated by Peertube systems. Per default " "they are not processed for performance reasons. Only activate this option on " "performant system." msgstr "" -#: src/Module/Admin/Site.php:572 +#: src/Module/Admin/Site.php:575 msgid "Days, after which a contact is archived" msgstr "" -#: src/Module/Admin/Site.php:572 +#: src/Module/Admin/Site.php:575 msgid "" "Number of days that we try to deliver content or to update the contact data " "before we archive a contact." msgstr "" -#: src/Module/Admin/Site.php:574 +#: src/Module/Admin/Site.php:577 msgid "Maximum number of parallel workers" msgstr "" -#: src/Module/Admin/Site.php:574 +#: src/Module/Admin/Site.php:577 #, php-format msgid "" "On shared hosters set this to %d. On larger systems, values of %d are great. " "Default value is %d." msgstr "" -#: src/Module/Admin/Site.php:575 +#: src/Module/Admin/Site.php:578 msgid "Maximum load for workers" msgstr "" -#: src/Module/Admin/Site.php:575 +#: src/Module/Admin/Site.php:578 msgid "Maximum load that causes a cooldown before each worker function call." msgstr "" -#: src/Module/Admin/Site.php:576 +#: src/Module/Admin/Site.php:579 msgid "Enable fastlane" msgstr "" -#: src/Module/Admin/Site.php:576 +#: src/Module/Admin/Site.php:579 msgid "" "When enabed, the fastlane mechanism starts an additional worker if processes " "with higher priority are blocked by processes of lower priority." msgstr "" -#: src/Module/Admin/Site.php:577 +#: src/Module/Admin/Site.php:580 msgid "Decoupled receiver" msgstr "" -#: src/Module/Admin/Site.php:577 +#: src/Module/Admin/Site.php:580 msgid "" "Decouple incoming ActivityPub posts by processing them in the background via " "a worker process. Only enable this on fast systems." msgstr "" -#: src/Module/Admin/Site.php:578 +#: src/Module/Admin/Site.php:581 msgid "Cron interval" msgstr "" -#: src/Module/Admin/Site.php:578 +#: src/Module/Admin/Site.php:581 msgid "Minimal period in minutes between two calls of the \"Cron\" worker job." msgstr "" -#: src/Module/Admin/Site.php:579 +#: src/Module/Admin/Site.php:582 msgid "Worker defer limit" msgstr "" -#: src/Module/Admin/Site.php:579 +#: src/Module/Admin/Site.php:582 msgid "" "Per default the systems tries delivering for 15 times before dropping it." msgstr "" -#: src/Module/Admin/Site.php:580 +#: src/Module/Admin/Site.php:583 msgid "Worker fetch limit" msgstr "" -#: src/Module/Admin/Site.php:580 +#: src/Module/Admin/Site.php:583 msgid "" "Number of worker tasks that are fetched in a single query. Higher values " "should increase the performance, too high values will mostly likely decrease " @@ -5378,142 +5388,142 @@ msgid "" "system." msgstr "" -#: src/Module/Admin/Site.php:582 +#: src/Module/Admin/Site.php:585 msgid "Direct relay transfer" msgstr "" -#: src/Module/Admin/Site.php:582 +#: src/Module/Admin/Site.php:585 msgid "" "Enables the direct transfer to other servers without using the relay servers" msgstr "" -#: src/Module/Admin/Site.php:583 +#: src/Module/Admin/Site.php:586 msgid "Relay scope" msgstr "" -#: src/Module/Admin/Site.php:583 +#: src/Module/Admin/Site.php:586 msgid "" "Can be \"all\" or \"tags\". \"all\" means that every public post should be " "received. \"tags\" means that only posts with selected tags should be " "received." msgstr "" -#: src/Module/Admin/Site.php:583 src/Module/Contact/Profile.php:309 +#: src/Module/Admin/Site.php:586 src/Module/Contact/Profile.php:309 #: src/Module/Settings/TwoFactor/Index.php:146 msgid "Disabled" msgstr "" -#: src/Module/Admin/Site.php:583 +#: src/Module/Admin/Site.php:586 msgid "all" msgstr "" -#: src/Module/Admin/Site.php:583 +#: src/Module/Admin/Site.php:586 msgid "tags" msgstr "" -#: src/Module/Admin/Site.php:584 +#: src/Module/Admin/Site.php:587 msgid "Server tags" msgstr "" -#: src/Module/Admin/Site.php:584 +#: src/Module/Admin/Site.php:587 msgid "Comma separated list of tags for the \"tags\" subscription." msgstr "" -#: src/Module/Admin/Site.php:585 +#: src/Module/Admin/Site.php:588 msgid "Deny Server tags" msgstr "" -#: src/Module/Admin/Site.php:585 +#: src/Module/Admin/Site.php:588 msgid "Comma separated list of tags that are rejected." msgstr "" -#: src/Module/Admin/Site.php:586 +#: src/Module/Admin/Site.php:589 msgid "Allow user tags" msgstr "" -#: src/Module/Admin/Site.php:586 +#: src/Module/Admin/Site.php:589 msgid "" "If enabled, the tags from the saved searches will used for the \"tags\" " "subscription in addition to the \"relay_server_tags\"." msgstr "" -#: src/Module/Admin/Site.php:587 +#: src/Module/Admin/Site.php:590 msgid "Deny undetected languages" msgstr "" -#: src/Module/Admin/Site.php:587 +#: src/Module/Admin/Site.php:590 msgid "If enabled, posts with undetected languages will be rejected." msgstr "" -#: src/Module/Admin/Site.php:588 +#: src/Module/Admin/Site.php:591 msgid "Language Quality" msgstr "" -#: src/Module/Admin/Site.php:588 +#: src/Module/Admin/Site.php:591 msgid "The minimum language quality that is required to accept the post." msgstr "" -#: src/Module/Admin/Site.php:589 +#: src/Module/Admin/Site.php:592 msgid "Number of languages for the language detection" msgstr "" -#: src/Module/Admin/Site.php:589 +#: src/Module/Admin/Site.php:592 msgid "" "The system detects a list of languages per post. Only if the desired " "languages are in the list, the message will be accepted. The higher the " "number, the more posts will be falsely detected." msgstr "" -#: src/Module/Admin/Site.php:591 +#: src/Module/Admin/Site.php:594 msgid "Maximum age of channel" msgstr "" -#: src/Module/Admin/Site.php:591 +#: src/Module/Admin/Site.php:594 msgid "" "This defines the maximum age in hours of items that should be displayed in " "channels. This affects the channel performance." msgstr "" -#: src/Module/Admin/Site.php:592 +#: src/Module/Admin/Site.php:595 msgid "Maximum number of channel posts" msgstr "" -#: src/Module/Admin/Site.php:592 +#: src/Module/Admin/Site.php:595 msgid "" "For performance reasons, the channels use a dedicated table to store " "content. The higher the value the slower the channels." msgstr "" -#: src/Module/Admin/Site.php:593 +#: src/Module/Admin/Site.php:596 msgid "Interaction score days" msgstr "" -#: src/Module/Admin/Site.php:593 +#: src/Module/Admin/Site.php:596 msgid "Number of days that are used to calculate the interaction score." msgstr "" -#: src/Module/Admin/Site.php:594 +#: src/Module/Admin/Site.php:597 msgid "Maximum number of posts per author" msgstr "" -#: src/Module/Admin/Site.php:594 +#: src/Module/Admin/Site.php:597 msgid "" "Maximum number of posts per page by author if the contact frequency is set " "to \"Display only few posts\". If there are more posts, then the post with " "the most interactions will be displayed." msgstr "" -#: src/Module/Admin/Site.php:595 +#: src/Module/Admin/Site.php:598 msgid "Sharer interaction days" msgstr "" -#: src/Module/Admin/Site.php:595 +#: src/Module/Admin/Site.php:598 msgid "" "Number of days of the last interaction that are used to define which sharers " "are used for the \"sharers of sharers\" channel." msgstr "" -#: src/Module/Admin/Site.php:598 +#: src/Module/Admin/Site.php:601 msgid "Start Relocation" msgstr "" diff --git a/view/templates/admin/site.tpl b/view/templates/admin/site.tpl index 94404b9020..75efff43c8 100644 --- a/view/templates/admin/site.tpl +++ b/view/templates/admin/site.tpl @@ -116,6 +116,7 @@

{{$performance}}

{{include file="field_checkbox.tpl" field=$compute_circle_counts}} {{include file="field_checkbox.tpl" field=$only_tag_search}} + {{include file="field_input.tpl" field=$search_age_days}} {{include file="field_input.tpl" field=$max_comments}} {{include file="field_input.tpl" field=$max_display_comments}} {{include file="field_input.tpl" field=$itemspage_network}} diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index 0d3a8a3118..a7de90480d 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -250,6 +250,7 @@
{{include file="field_checkbox.tpl" field=$compute_circle_counts}} {{include file="field_checkbox.tpl" field=$only_tag_search}} + {{include file="field_input.tpl" field=$search_age_days}} {{include file="field_input.tpl" field=$max_comments}} {{include file="field_input.tpl" field=$max_display_comments}} {{include file="field_input.tpl" field=$itemspage_network}} From 5a33a494e88388778646eda6305e40c1d9d64163 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 21 Jan 2024 16:39:28 +0000 Subject: [PATCH 5/6] Updated full text indexes --- database.sql | 4 ++-- doc/database/db_post-content.md | 13 ++++++------- doc/database/db_post-searchindex.md | 2 ++ doc/database/db_profile.md | 9 ++++----- static/dbstructure.config.php | 2 -- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/database.sql b/database.sql index e3397a44aa..91ed8bf3cd 100644 --- a/database.sql +++ b/database.sql @@ -1293,7 +1293,6 @@ CREATE TABLE IF NOT EXISTS `post-content` ( PRIMARY KEY(`uri-id`), INDEX `plink` (`plink`(191)), INDEX `resource-id` (`resource-id`), - FULLTEXT INDEX `title-content-warning-body` (`title`,`content-warning`,`body`), INDEX `quote-uri-id` (`quote-uri-id`), FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`quote-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE @@ -1468,7 +1467,9 @@ CREATE TABLE IF NOT EXISTS `post-searchindex` ( `network` char(4) COMMENT '', `private` tinyint unsigned COMMENT '0=public, 1=private, 2=unlisted', `searchtext` mediumtext COMMENT 'Simplified text for the full text search', + `created` datetime COMMENT '', PRIMARY KEY(`uri-id`), + INDEX `created` (`created`), FULLTEXT INDEX `searchtext` (`searchtext`), FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts'; @@ -1724,7 +1725,6 @@ CREATE TABLE IF NOT EXISTS `profile` ( `net-publish` boolean NOT NULL DEFAULT '0' COMMENT 'publish profile in global directory', PRIMARY KEY(`id`), INDEX `uid_is-default` (`uid`,`is-default`), - FULLTEXT INDEX `pub_keywords` (`pub_keywords`), FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='user profiles data'; diff --git a/doc/database/db_post-content.md b/doc/database/db_post-content.md index 27b372093a..be45975a72 100644 --- a/doc/database/db_post-content.md +++ b/doc/database/db_post-content.md @@ -30,13 +30,12 @@ Fields Indexes ------------ -| Name | Fields | -| -------------------------- | -------------------------------------- | -| PRIMARY | uri-id | -| plink | plink(191) | -| resource-id | resource-id | -| title-content-warning-body | FULLTEXT, title, content-warning, body | -| quote-uri-id | quote-uri-id | +| Name | Fields | +| ------------ | ------------ | +| PRIMARY | uri-id | +| plink | plink(191) | +| resource-id | resource-id | +| quote-uri-id | quote-uri-id | Foreign Keys ------------ diff --git a/doc/database/db_post-searchindex.md b/doc/database/db_post-searchindex.md index a5dec8de1b..a6f5879854 100644 --- a/doc/database/db_post-searchindex.md +++ b/doc/database/db_post-searchindex.md @@ -12,6 +12,7 @@ Fields | network | | char(4) | YES | | NULL | | | private | 0=public, 1=private, 2=unlisted | tinyint unsigned | YES | | NULL | | | searchtext | Simplified text for the full text search | mediumtext | YES | | NULL | | +| created | | datetime | YES | | NULL | | Indexes ------------ @@ -19,6 +20,7 @@ Indexes | Name | Fields | | ---------- | -------------------- | | PRIMARY | uri-id | +| created | created | | searchtext | FULLTEXT, searchtext | Foreign Keys diff --git a/doc/database/db_profile.md b/doc/database/db_profile.md index c4a8b01709..09f10770be 100644 --- a/doc/database/db_profile.md +++ b/doc/database/db_profile.md @@ -56,11 +56,10 @@ Fields Indexes ------------ -| Name | Fields | -| -------------- | ---------------------- | -| PRIMARY | id | -| uid_is-default | uid, is-default | -| pub_keywords | FULLTEXT, pub_keywords | +| Name | Fields | +| -------------- | --------------- | +| PRIMARY | id | +| uid_is-default | uid, is-default | Foreign Keys ------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 23c255395f..b376778e36 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1319,7 +1319,6 @@ return [ "PRIMARY" => ["uri-id"], "plink" => ["plink(191)"], "resource-id" => ["resource-id"], - "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"], "quote-uri-id" => ["quote-uri-id"], ] ], @@ -1723,7 +1722,6 @@ return [ "indexes" => [ "PRIMARY" => ["id"], "uid_is-default" => ["uid", "is-default"], - "pub_keywords" => ["FULLTEXT", "pub_keywords"], ] ], "profile_field" => [ From 39e1f2c0fce34cae1fff31df7f670fdbc423a2a2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 21 Jan 2024 17:05:18 +0000 Subject: [PATCH 6/6] Code standards --- src/Model/Post/SearchIndex.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Model/Post/SearchIndex.php b/src/Model/Post/SearchIndex.php index ef3a3022f1..1fbbe0b3f4 100644 --- a/src/Model/Post/SearchIndex.php +++ b/src/Model/Post/SearchIndex.php @@ -47,10 +47,10 @@ class SearchIndex } $search = [ - 'uri-id' => $uri_id, - 'network' => $network, - 'private' => $private, - 'created' => $created, + 'uri-id' => $uri_id, + 'network' => $network, + 'private' => $private, + 'created' => $created, 'searchtext' => Post\Engagement::getSearchTextForUriId($uri_id, $refresh), ]; return DBA::insert('post-searchindex', $search, Database::INSERT_UPDATE); @@ -66,7 +66,12 @@ class SearchIndex $searchtext = Post\Engagement::getSearchTextForUriId($uri_id, true); return DBA::update('post-searchindex', ['searchtext' => $searchtext], ['uri-id' => $uri_id]); } - + + /** + * Expire old searchindex entries + * + * @return void + */ public static function expire() { $limit = self::searchAgeDateLimit();