From 5a33a494e88388778646eda6305e40c1d9d64163 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 21 Jan 2024 16:39:28 +0000 Subject: [PATCH] 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" => [