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/EntryDAOSQLite.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'app/Models/EntryDAOSQLite.php') diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php index 16d15f899..e4e079959 100644 --- a/app/Models/EntryDAOSQLite.php +++ b/app/Models/EntryDAOSQLite.php @@ -2,19 +2,23 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { - public function isCompressed(): bool { + public static function isCompressed(): bool { return false; } - public function hasNativeHex(): bool { + public static function hasNativeHex(): bool { return false; } - public function sqlHexDecode(string $x): string { + protected static function sqlConcat($s1, $s2) { + return $s1 . '||' . $s2; + } + + public static function sqlHexDecode(string $x): string { return $x; } - public function sqlIgnoreConflict(string $sql): string { + public static function sqlIgnoreConflict(string $sql): string { return str_replace('INSERT INTO ', 'INSERT OR IGNORE INTO ', $sql); } @@ -65,10 +69,6 @@ DROP TABLE IF EXISTS `tmp`; return $result; } - protected function sqlConcat($s1, $s2) { - return $s1 . '||' . $s2; - } - protected function updateCacheUnreads($catId = false, $feedId = false) { $sql = 'UPDATE `_feed` ' . 'SET `cache_nbUnreads`=(' -- cgit v1.2.3