]> git.mxchange.org Git - friendica.git/commitdiff
"test" is renamed to "check", documentation for platform added
authorMichael <heluecht@pirati.ca>
Wed, 15 Nov 2023 17:55:45 +0000 (17:55 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 15 Nov 2023 17:55:45 +0000 (17:55 +0000)
database.sql
doc/Channels.md
doc/database.md
doc/database/db_test-full-text-search.md
src/Content/Conversation/Repository/UserDefinedChannel.php
src/Worker/OptimizeTables.php
static/dbstructure.config.php

index 39a56e7966bbbdefe121249da87211d25d8c6bff..86f8e82eb5397582884753afec3bbd6ba5bae69b 100644 (file)
@@ -1868,14 +1868,14 @@ CREATE TABLE IF NOT EXISTS `subscription` (
 ) 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` (
-       `pid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Process id of the worker',
+CREATE TABLE IF NOT EXISTS `check-full-text-search` (
+       `pid` int unsigned NOT NULL COMMENT 'The ID of the process',
        `searchtext` mediumtext COMMENT 'Simplified text for the full text search',
         PRIMARY KEY(`pid`),
         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
index 260b96294228089f1025172726cd703a4da3ea7a..091b53930dda6efdb36b2aa88f5691c755780932 100644 (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:tmbl - Posts that are received by the Tumblr 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:public
     * visibility:unlisted
index 0ed116bc73b5dcf5cd6793072cbdf4d2486ce465..26519ccfb449a0c1ba9e02c19789660845b6c061 100644 (file)
@@ -18,6 +18,7 @@ Database Tables
 | [attach](help/database/db_attach) | file attachments |
 | [cache](help/database/db_cache) | Stores temporary data |
 | [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 |
 | [contact](help/database/db_contact) | contact table |
 | [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 |
 | [subscription](help/database/db_subscription) | Push Subscription for the API |
 | [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-contact](help/database/db_user-contact) | User specific public contact data |
 | [user-gserver](help/database/db_user-gserver) | User settings about remote servers |
index b6b9bd19e91b7e4796c67d5cb3bdb0edea188ac2..e9bdbec35387f27e605f0f8f86021944f9ed6942 100644 (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
 ------
index a414f83c2541f9fcd74da2598e0bd3bb65f33b1b..db7160ac8759b9ee4614f8baf89e3743f81a3a16 100644 (file)
@@ -154,14 +154,14 @@ class UserDefinedChannel extends \Friendica\BaseRepository
                }
 
                $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` != ?", '']);
                while ($channel = $this->db->fetch($channels)) {
                        $channelsearchtext = $channel['full-text-search'];
                        foreach (['from', 'to', 'group', 'tag', 'network', 'platform', 'visibility'] as $keyword) {
                                $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'])]))) {
                                        $store = true;
                                        $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->delete('test-full-text-search', ['pid' => getmypid()]);
+               $this->db->delete('check-full-text-search', ['pid' => getmypid()]);
                return $store;
        }
 }
index db525fce2b24c22388661a6b8beba7237f18afc6..50f9341d729574eee811f29dcba174e5d670c389 100644 (file)
@@ -46,7 +46,7 @@ class OptimizeTables
                DBA::optimizeTable('parsed_url');
                DBA::optimizeTable('session');
                DBA::optimizeTable('post-engagement');
-               DBA::optimizeTable('test-full-text-search');
+               DBA::optimizeTable('check-full-text-search');
 
                if (DI::config()->get('system', 'optimize_all_tables')) {
                        DBA::optimizeTable('apcontact');
index 1e72868860a06bf8880a5226982f4f4698b838e3..be16270ca2cb553c77bba3f67502e3a9d8851684 100644 (file)
@@ -1858,10 +1858,10 @@ return [
                        "uid_application-id" => ["uid", "application-id"],
                ]
        ],
-       "test-full-text-search" => [
-               "comment" => "Test for a full text search match in user defined channels before storing the message in the system",
+       "check-full-text-search" => [
+               "comment" => "Check for a full text search match in user defined channels before storing the message in the system",
                "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"],
                ],
                "indexes" => [