server: use fetched contents of news for search index

This commit is contained in:
2025-01-29 14:08:20 -08:00
parent c7aa32b922
commit 12c8e0e33b
12 changed files with 168 additions and 87 deletions

View File

@@ -1,10 +1,9 @@
SELECT
COUNT(*) count
SELECT COUNT(*) AS count
FROM
post
WHERE
(
$1 :: text IS NULL
$1::text IS NULL
OR site = $1
)
AND (
@@ -12,6 +11,7 @@ WHERE
OR NOT is_read
)
AND (
$3 :: text IS NULL
OR to_tsvector('english', summary) @@ websearch_to_tsquery('english', $3)
$3::text IS NULL
OR TO_TSVECTOR('english', search_summary)
@@ WEBSEARCH_TO_TSQUERY('english', $3)
)

View File

@@ -0,0 +1,8 @@
SELECT
p.id,
link,
clean_summary
FROM
post AS p
INNER JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts
WHERE search_summary IS NULL;

View File

@@ -16,7 +16,7 @@ WHERE
)
AND (
$5 :: text IS NULL
OR to_tsvector('english', summary) @@ websearch_to_tsquery('english', $5)
OR to_tsvector('english', search_summary) @@ websearch_to_tsquery('english', $5)
)
ORDER BY
date DESC,