mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:40:17 +00:00
"test" is renamed to "check", documentation for platform added
This commit is contained in:
parent
43f9be367f
commit
1dfb0ce81c
7 changed files with 15 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 |
|
||||
|
|
|
@ -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
|
||||
------
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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" => [
|
||||
|
|
Loading…
Reference in a new issue