From f85c510ed49be031145f6b35e815ce890cd4f9aa Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 2 Jun 2022 08:41:08 +0200 Subject: New search engine (#4378) * New possibility to invoke user queries from a search expression From the search field: `S:"My query"`. Can be combined with other filters such as `S:"My query" date:P3d` as long as the user queries do not contain `OR`. A use-case is to have an RSS filter with a stable address or an external API call with the ability to update the user query. * Draft of parenthesis logic * More draft * Working parenthesis (a OR b) (c OR d) * Working (A) OR (B) * Support nested parentheses + unit tests + documentation * search:MySearch and S:3 --- app/Models/EntryDAOPGSQL.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Models/EntryDAOPGSQL.php') diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php index b97417a7c..13bf8b41f 100644 --- a/app/Models/EntryDAOPGSQL.php +++ b/app/Models/EntryDAOPGSQL.php @@ -2,19 +2,19 @@ class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite { - public function hasNativeHex(): bool { + public static function hasNativeHex(): bool { return true; } - public function sqlHexDecode(string $x): string { + public static function sqlHexDecode(string $x): string { return 'decode(' . $x . ", 'hex')"; } - public function sqlHexEncode(string $x): string { + public static function sqlHexEncode(string $x): string { return 'encode(' . $x . ", 'hex')"; } - public function sqlIgnoreConflict(string $sql): string { + public static function sqlIgnoreConflict(string $sql): string { return rtrim($sql, ' ;') . ' ON CONFLICT DO NOTHING'; } -- cgit v1.2.3