diff options
| author | 2022-08-16 10:56:07 +0200 | |
|---|---|---|
| committer | 2022-08-16 10:56:07 +0200 | |
| commit | e27eb1ca9198119ea1b0bd79be5f1aead45d615a (patch) | |
| tree | fd4e2767ab4d65a68b437d77f57b9e6274a65b9d /tests/app | |
| parent | 8587efa62189a30e3e47075739382d52ecc34cb6 (diff) | |
Basic support for negative searches with parentheses (#4503)
* Basic support for negative searches with parentheses
* `!((author:Alice intitle:hello) OR (author:Bob intitle:world))`
* `(author:Alice intitle:hello) !(author:Bob intitle:world)`
* `!(S:1 OR S:2)`
* Minor documentation / comment
* Remove syslog debug line
Diffstat (limited to 'tests/app')
| -rw-r--r-- | tests/app/Models/SearchTest.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php index 74c1596f6..3fb5a144f 100644 --- a/tests/app/Models/SearchTest.php +++ b/tests/app/Models/SearchTest.php @@ -330,6 +330,16 @@ class SearchTest extends PHPUnit\Framework\TestCase { ' ((e.id IN (SELECT et.id_entry FROM `_entrytag` et, `_tag` t WHERE et.id_tag = t.id AND t.name IN (?)) )) ', ['%tag%','%Hello%','%Alice%','%example%','3','%World%', 'Bleu'] ], + [ + '!((author:Alice intitle:hello) OR (author:Bob intitle:world))', + ' NOT (((e.author LIKE ? AND e.title LIKE ? )) OR ((e.author LIKE ? AND e.title LIKE ? ))) ', + ['%Alice%', '%hello%', '%Bob%', '%world%'], + ], + [ + '(author:Alice intitle:hello) !(author:Bob intitle:world)', + ' ((e.author LIKE ? AND e.title LIKE ? )) AND NOT ((e.author LIKE ? AND e.title LIKE ? )) ', + ['%Alice%', '%hello%', '%Bob%', '%world%'], + ] ]; } } |
