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/UserQuery.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/Models/UserQuery.php') diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php index 236813942..964324bf7 100644 --- a/app/Models/UserQuery.php +++ b/app/Models/UserQuery.php @@ -14,6 +14,7 @@ class FreshRSS_UserQuery { private $get_type; private $name; private $order; + /** @var FreshRSS_BooleanSearch */ private $search; private $state; private $url; @@ -34,7 +35,7 @@ class FreshRSS_UserQuery { $this->parseGet($query['get']); } if (isset($query['name'])) { - $this->name = $query['name']; + $this->name = trim($query['name']); } if (isset($query['order'])) { $this->order = $query['order']; @@ -42,7 +43,7 @@ class FreshRSS_UserQuery { if (empty($query['url'])) { if (!empty($query)) { unset($query['name']); - $this->url = Minz_Url::display(array('params' => $query)); + $this->url = Minz_Url::display(['params' => $query]); } } else { $this->url = $query['url']; -- cgit v1.2.3