diff --git a/sql/fix_search_posts.sql b/sql/fix_search_posts.sql index f05bb03..d778bfc 100644 --- a/sql/fix_search_posts.sql +++ b/sql/fix_search_posts.sql @@ -54,6 +54,7 @@ RETURNS SETOF catalog_grid_result AS $$ AND attachments.attachment_idx = 1 , query WHERE p.body_search_index @@ query.query + LIMIT 2000 ) SELECT 0 AS estimated_post_count, diff --git a/sql/initialize.sql b/sql/initialize.sql index 93e54d7..8fb046d 100644 --- a/sql/initialize.sql +++ b/sql/initialize.sql @@ -336,6 +336,7 @@ $$ LANGUAGE sql; -- Example: -- -- To search for posts related to 'quantum computing': -- SELECT * FROM search_posts('quantum computing'); + CREATE OR REPLACE FUNCTION search_posts(search_text text) RETURNS SETOF catalog_grid_result AS $$ WITH @@ -365,6 +366,7 @@ RETURNS SETOF catalog_grid_result AS $$ AND attachments.attachment_idx = 1 , query WHERE p.body_search_index @@ query.query + LIMIT 2000 ) SELECT 0 AS estimated_post_count,