X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/2591b1770a0d108069a8b1ffee485ae02f796263..b6f6103a8b578d13047219ef3812cea09001eea2:/forum_modules/pgfulltext/pg_fts_install.sql?ds=inline

diff --git a/forum_modules/pgfulltext/pg_fts_install.sql b/forum_modules/pgfulltext/pg_fts_install.sql
index bba7eef..ddc48a1 100644
--- a/forum_modules/pgfulltext/pg_fts_install.sql
+++ b/forum_modules/pgfulltext/pg_fts_install.sql
@@ -53,10 +53,11 @@ begin
         return new;
     END IF;
 
-    doc :=
-      setweight(to_tsvector('english', coalesce(new.tagnames,'')), 'A') ||
-      setweight(to_tsvector('english', coalesce(new.title,'')), 'B') ||
-      setweight(to_tsvector('english', coalesce(new.body,'')), 'C');
+    SELECT
+      setweight(to_tsvector('english', coalesce(tagnames,'')), 'A') ||
+      setweight(to_tsvector('english', coalesce(title,'')), 'B') ||
+      setweight(to_tsvector('english', coalesce(body,'')), 'C') INTO doc
+      FROM forum_node WHERE id = root_id;
 
     SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND deleted_id IS NULL;
 
