]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/pgfulltext/pg_fts_install.sql
Some changes necessary to make cache work on Django 1.2.
[osqa.git] / forum_modules / pgfulltext / pg_fts_install.sql
index bba7eefcc1f406d8609b57d555b5f37113fb9499..ddc48a1b8f63e52f22b18c050e71c02746c384b5 100644 (file)
@@ -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;