X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/eb5d07faf2fe743f482ba8b3168e083e4df29434..c9c3cb4c714911710f606f8dc47d5e65707aff67:/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 4161fd8..e08e22b 100644
--- a/forum_modules/pgfulltext/pg_fts_install.sql
+++ b/forum_modules/pgfulltext/pg_fts_install.sql
@@ -59,10 +59,10 @@ begin
       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;
+    SELECT count(*)::int INTO rcount FROM forum_node WHERE abs_parent_id = root_id AND (NOT state_string LIKE '%%deleted%%');
 
     IF rcount > 0 THEN
-       FOR cv in SELECT setweight(to_tsvector('english', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id  AND deleted_id IS NULL LOOP
+       FOR cv in SELECT setweight(to_tsvector('english', coalesce(body,'')), 'C') FROM forum_node WHERE abs_parent_id = root_id  AND (NOT state_string LIKE '%%deleted%%') LOOP
            doc :=(doc || cv);
        END LOOP;
      END IF;
@@ -116,4 +116,5 @@ begin
 end
 $$ LANGUAGE plpgsql;
 
+ALTER table forum_rootnode_doc DISABLE TRIGGER ALL;
 UPDATE forum_noderevision SET id = id WHERE TRUE;
