From c04f8ebe459e5b732379fed2524b4829c8cf1682 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Sat, 2 Mar 2024 03:09:34 -0500 Subject: [PATCH] make sure search_posts is the same in both scripts --- sql/initialize.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/initialize.sql b/sql/initialize.sql index 26c593a..1d72ba5 100644 --- a/sql/initialize.sql +++ b/sql/initialize.sql @@ -336,7 +336,7 @@ $$ LANGUAGE sql STABLE; -- -- To search for posts related to 'quantum computing': -- SELECT * FROM search_posts('quantum computing'); -CREATE OR REPLACE FUNCTION search_posts(search_text text) +CREATE OR REPLACE FUNCTION search_posts(search_text text, max_rows integer DEFAULT 1000) RETURNS SETOF catalog_grid_result AS $$ WITH query AS ( @@ -365,7 +365,7 @@ RETURNS SETOF catalog_grid_result AS $$ AND attachments.attachment_idx = 1 , query WHERE p.body_search_index @@ query.query - LIMIT 2000 + LIMIT max_rows ) SELECT 0 AS estimated_post_count,