limit search results to 2000 items
This commit is contained in:
parent
db6f168c2f
commit
09bb17f19c
|
@ -54,6 +54,7 @@ RETURNS SETOF catalog_grid_result AS $$
|
||||||
AND attachments.attachment_idx = 1
|
AND attachments.attachment_idx = 1
|
||||||
, query
|
, query
|
||||||
WHERE p.body_search_index @@ query.query
|
WHERE p.body_search_index @@ query.query
|
||||||
|
LIMIT 2000
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
0 AS estimated_post_count,
|
0 AS estimated_post_count,
|
||||||
|
|
|
@ -336,6 +336,7 @@ $$ LANGUAGE sql;
|
||||||
-- Example:
|
-- Example:
|
||||||
-- -- To search for posts related to 'quantum computing':
|
-- -- To search for posts related to 'quantum computing':
|
||||||
-- SELECT * FROM search_posts('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)
|
||||||
RETURNS SETOF catalog_grid_result AS $$
|
RETURNS SETOF catalog_grid_result AS $$
|
||||||
WITH
|
WITH
|
||||||
|
@ -365,6 +366,7 @@ RETURNS SETOF catalog_grid_result AS $$
|
||||||
AND attachments.attachment_idx = 1
|
AND attachments.attachment_idx = 1
|
||||||
, query
|
, query
|
||||||
WHERE p.body_search_index @@ query.query
|
WHERE p.body_search_index @@ query.query
|
||||||
|
LIMIT 2000
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
0 AS estimated_post_count,
|
0 AS estimated_post_count,
|
||||||
|
|
Loading…
Reference in New Issue