X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/64fe9d425edc29234d9a6bf4dc23c52673fd2bdf..55eea8d5a3f8fcc3a509f2eaf45005bba20fc76a:/forum_modules/mysqlfulltext/fts_install.sql

diff --git a/forum_modules/mysqlfulltext/fts_install.sql b/forum_modules/mysqlfulltext/fts_install.sql
index 5ad821e..c32bc31 100644
--- a/forum_modules/mysqlfulltext/fts_install.sql
+++ b/forum_modules/mysqlfulltext/fts_install.sql
@@ -2,9 +2,11 @@ CREATE TABLE forum_mysqlftsindex (
 	id int NOT NULL AUTO_INCREMENT,
 	node_id int NOT NULL UNIQUE,
 	body longtext NOT NULL,
+	title varchar(300),
+	tagnames varchar(255),
 	PRIMARY KEY (id),
 	FOREIGN KEY (node_id) REFERENCES forum_node (id)   ON UPDATE CASCADE ON DELETE CASCADE,
-	FULLTEXT (body)
+	FULLTEXT (body, title, tagnames)
 ) ENGINE=`MyISAM`;
 
 ALTER TABLE forum_mysqlftsindex CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
@@ -14,7 +16,7 @@ delimiter |
 CREATE TRIGGER fts_on_insert AFTER INSERT ON forum_node
   FOR EACH ROW
   BEGIN
-    INSERT INTO forum_mysqlftsindex (node_id, body) VALUES (NEW.id, UPPER(CONCAT_WS('\n', NEW.title, NEW.body, NEW.tagnames)));
+    INSERT INTO forum_mysqlftsindex (node_id, title, body, tagnames) VALUES (NEW.id, UPPER(NEW.title), UPPER(NEW.body), UPPER(NEW.tagnames));
   END;
 |
 
@@ -23,9 +25,9 @@ delimiter |
 CREATE TRIGGER fts_on_update AFTER UPDATE ON forum_node
   FOR EACH ROW
   BEGIN
-    UPDATE forum_mysqlftsindex SET body = UPPER(CONCAT_WS('\n', NEW.title, NEW.body, NEW.tagnames)) WHERE node_id = NEW.id;
+    UPDATE forum_mysqlftsindex SET title = UPPER(NEW.title), body = UPPER(NEW.body), tagnames = UPPER(NEW.tagnames) WHERE node_id = NEW.id;
   END;
 
 |
 
-INSERT INTO forum_mysqlftsindex (node_id, body) SELECT id, UPPER(CONCAT_WS('\n', title, body, tagnames)) FROM forum_node;
\ No newline at end of file
+INSERT INTO forum_mysqlftsindex (node_id, title, body, tagnames) SELECT id, UPPER(title), UPPER(body), UPPER(tagnames) FROM forum_node;
\ No newline at end of file
