"test" is renamed to "check", documentation for platform added

This commit is contained in:
Michael 2023-11-15 17:55:45 +00:00
parent 43f9be367f
commit 1dfb0ce81c
7 changed files with 15 additions and 14 deletions

View File

@ -1868,14 +1868,14 @@ CREATE TABLE IF NOT EXISTS `subscription` (
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Push Subscription for the API'; ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Push Subscription for the API';
-- --
-- TABLE test-full-text-search -- TABLE check-full-text-search
-- --
CREATE TABLE IF NOT EXISTS `test-full-text-search` ( CREATE TABLE IF NOT EXISTS `check-full-text-search` (
`pid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Process id of the worker', `pid` int unsigned NOT NULL COMMENT 'The ID of the process',
`searchtext` mediumtext COMMENT 'Simplified text for the full text search', `searchtext` mediumtext COMMENT 'Simplified text for the full text search',
PRIMARY KEY(`pid`), PRIMARY KEY(`pid`),
FULLTEXT INDEX `searchtext` (`searchtext`) FULLTEXT INDEX `searchtext` (`searchtext`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Test for a full text search match in user defined channels before storing the message in the system'; ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Check for a full text search match in user defined channels before storing the message in the system';
-- --
-- TABLE userd -- TABLE userd

View File

@ -68,6 +68,7 @@ Additionally to the search for content, there are additional keywords that can b
* network:dscs - Posts that are received by the Discourse connector. * network:dscs - Posts that are received by the Discourse connector.
* network:tmbl - Posts that are received by the Tumblr connector. * network:tmbl - Posts that are received by the Tumblr connector.
* network:bsky - Posts that are received by the Bluesky connector. * network:bsky - Posts that are received by the Bluesky connector.
* platform - Use this to include or exclude some platforms from your channel, e.g. "+platform:friendica".
* visibility - You have the choice between different visibilities. You can only see unlisted or private posts that you have the access for. * visibility - You have the choice between different visibilities. You can only see unlisted or private posts that you have the access for.
* visibility:public * visibility:public
* visibility:unlisted * visibility:unlisted

View File

@ -18,6 +18,7 @@ Database Tables
| [attach](help/database/db_attach) | file attachments | | [attach](help/database/db_attach) | file attachments |
| [cache](help/database/db_cache) | Stores temporary data | | [cache](help/database/db_cache) | Stores temporary data |
| [channel](help/database/db_channel) | User defined Channels | | [channel](help/database/db_channel) | User defined Channels |
| [check-full-text-search](help/database/db_check-full-text-search) | Check for a full text search match in user defined channels before storing the message in the system |
| [config](help/database/db_config) | main configuration storage | | [config](help/database/db_config) | main configuration storage |
| [contact](help/database/db_contact) | contact table | | [contact](help/database/db_contact) | contact table |
| [contact-relation](help/database/db_contact-relation) | Contact relations | | [contact-relation](help/database/db_contact-relation) | Contact relations |
@ -86,7 +87,6 @@ Database Tables
| [storage](help/database/db_storage) | Data stored by Database storage backend | | [storage](help/database/db_storage) | Data stored by Database storage backend |
| [subscription](help/database/db_subscription) | Push Subscription for the API | | [subscription](help/database/db_subscription) | Push Subscription for the API |
| [tag](help/database/db_tag) | tags and mentions | | [tag](help/database/db_tag) | tags and mentions |
| [test-full-text-search](help/database/db_test-full-text-search) | Test for a full text search match in user defined channels before storing the message in the system |
| [user](help/database/db_user) | The local users | | [user](help/database/db_user) | The local users |
| [user-contact](help/database/db_user-contact) | User specific public contact data | | [user-contact](help/database/db_user-contact) | User specific public contact data |
| [user-gserver](help/database/db_user-gserver) | User settings about remote servers | | [user-gserver](help/database/db_user-gserver) | User settings about remote servers |

View File

@ -1,7 +1,7 @@
Table test-full-text-search Table check-full-text-search
=========== ===========
Test for a full text search match in user defined channels before storing the message in the system Check for a full text search match in user defined channels before storing the message in the system
Fields Fields
------ ------

View File

@ -154,14 +154,14 @@ class UserDefinedChannel extends \Friendica\BaseRepository
} }
$store = false; $store = false;
$this->db->insert('test-full-text-search', ['pid' => getmypid(), 'searchtext' => $searchtext], Database::INSERT_UPDATE); $this->db->insert('check-full-text-search', ['pid' => getmypid(), 'searchtext' => $searchtext], Database::INSERT_UPDATE);
$channels = $this->db->select(self::$table_name, ['full-text-search', 'uid', 'label'], ["`full-text-search` != ?", '']); $channels = $this->db->select(self::$table_name, ['full-text-search', 'uid', 'label'], ["`full-text-search` != ?", '']);
while ($channel = $this->db->fetch($channels)) { while ($channel = $this->db->fetch($channels)) {
$channelsearchtext = $channel['full-text-search']; $channelsearchtext = $channel['full-text-search'];
foreach (['from', 'to', 'group', 'tag', 'network', 'platform', 'visibility'] as $keyword) { foreach (['from', 'to', 'group', 'tag', 'network', 'platform', 'visibility'] as $keyword) {
$channelsearchtext = preg_replace('~(' . $keyword . ':.[\w@\.-]+)~', '"$1"', $channelsearchtext); $channelsearchtext = preg_replace('~(' . $keyword . ':.[\w@\.-]+)~', '"$1"', $channelsearchtext);
} }
if ($this->db->exists('test-full-text-search', ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $channelsearchtext])) { if ($this->db->exists('check-full-text-search', ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $channelsearchtext])) {
if (in_array($language, $this->pConfig->get($channel['uid'], 'channel', 'languages', [User::getLanguageCode($channel['uid'])]))) { if (in_array($language, $this->pConfig->get($channel['uid'], 'channel', 'languages', [User::getLanguageCode($channel['uid'])]))) {
$store = true; $store = true;
$this->logger->debug('Matching channel found.', ['uid' => $channel['uid'], 'label' => $channel['label'], 'language' => $language, 'channelsearchtext' => $channelsearchtext, 'searchtext' => $searchtext]); $this->logger->debug('Matching channel found.', ['uid' => $channel['uid'], 'label' => $channel['label'], 'language' => $language, 'channelsearchtext' => $channelsearchtext, 'searchtext' => $searchtext]);
@ -171,7 +171,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository
} }
$this->db->close($channels); $this->db->close($channels);
$this->db->delete('test-full-text-search', ['pid' => getmypid()]); $this->db->delete('check-full-text-search', ['pid' => getmypid()]);
return $store; return $store;
} }
} }

View File

@ -46,7 +46,7 @@ class OptimizeTables
DBA::optimizeTable('parsed_url'); DBA::optimizeTable('parsed_url');
DBA::optimizeTable('session'); DBA::optimizeTable('session');
DBA::optimizeTable('post-engagement'); DBA::optimizeTable('post-engagement');
DBA::optimizeTable('test-full-text-search'); DBA::optimizeTable('check-full-text-search');
if (DI::config()->get('system', 'optimize_all_tables')) { if (DI::config()->get('system', 'optimize_all_tables')) {
DBA::optimizeTable('apcontact'); DBA::optimizeTable('apcontact');

View File

@ -1858,10 +1858,10 @@ return [
"uid_application-id" => ["uid", "application-id"], "uid_application-id" => ["uid", "application-id"],
] ]
], ],
"test-full-text-search" => [ "check-full-text-search" => [
"comment" => "Test for a full text search match in user defined channels before storing the message in the system", "comment" => "Check for a full text search match in user defined channels before storing the message in the system",
"fields" => [ "fields" => [
"pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"], "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
"searchtext" => ["type" => "mediumtext", "comment" => "Simplified text for the full text search"], "searchtext" => ["type" => "mediumtext", "comment" => "Simplified text for the full text search"],
], ],
"indexes" => [ "indexes" => [