web & server: using tantivy for news post search
This commit is contained in:
@@ -6,6 +6,9 @@ SELECT
|
||||
date,
|
||||
is_read,
|
||||
uid,
|
||||
id
|
||||
FROM post
|
||||
WHERE title ILIKE '%grapheme%' OR summary ILIKE '%grapheme%';
|
||||
p.id id
|
||||
FROM
|
||||
post AS p
|
||||
JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts
|
||||
ORDER BY
|
||||
date DESC;
|
||||
|
||||
6
server/sql/all-uids.sql
Normal file
6
server/sql/all-uids.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
SELECT
|
||||
uid
|
||||
FROM
|
||||
post AS p
|
||||
JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts
|
||||
;
|
||||
@@ -3,7 +3,10 @@ SELECT
|
||||
FROM
|
||||
post
|
||||
WHERE
|
||||
($1::text IS NULL OR site = $1)
|
||||
(
|
||||
$1 :: text IS NULL
|
||||
OR site = $1
|
||||
)
|
||||
AND (
|
||||
NOT $2
|
||||
OR NOT is_read
|
||||
|
||||
14
server/sql/posts-from-uids.sql
Normal file
14
server/sql/posts-from-uids.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
SELECT
|
||||
site AS "site!",
|
||||
title AS "title!",
|
||||
summary AS "summary!",
|
||||
link AS "link!",
|
||||
date AS "date!",
|
||||
is_read AS "is_read!",
|
||||
uid AS "uid!",
|
||||
p.id id
|
||||
FROM
|
||||
post p
|
||||
JOIN feed f ON p.site = f.slug
|
||||
WHERE
|
||||
uid = ANY ($1);
|
||||
@@ -10,4 +10,5 @@ FROM
|
||||
JOIN feed f ON p.site = f.slug
|
||||
WHERE
|
||||
uid = ANY ($1)
|
||||
;
|
||||
ORDER BY
|
||||
date DESC;
|
||||
|
||||
Reference in New Issue
Block a user