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
This commit is contained in:
Alexandre Alapetite
2022-06-02 08:41:08 +02:00
committed by GitHub
parent f988b996ab
commit f85c510ed4
12 changed files with 663 additions and 380 deletions

View File

@@ -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'];