From 4d153eeaf85905e8402cc8d175f202967d909020 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 21 Mar 2022 12:51:03 +0100 Subject: Fix some search expressions (#4277) * Fix some search expressions * Fix decoding bug when using quotes to search free text containing some spaces such as `"ab cd"` * Fix use of `-` wrongly triggering a negative search in e.g. `ab-cd` * Fix edge cases * A couple of tests --- tests/app/Models/SearchTest.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php index bef548b02..b43834147 100644 --- a/tests/app/Models/SearchTest.php +++ b/tests/app/Models/SearchTest.php @@ -51,6 +51,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { public function provideIntitleSearch() { return array( array('intitle:word1', array('word1'), null), + array('intitle:word1-word2', array('word1-word2'), null), array('intitle:word1 word2', array('word1'), array('word2')), array('intitle:"word1 word2"', array('word1 word2'), null), array("intitle:'word1 word2'", array('word1 word2'), null), @@ -88,6 +89,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { public function provideAuthorSearch() { return array( array('author:word1', array('word1'), null), + array('author:word1-word2', array('word1-word2'), null), array('author:word1 word2', array('word1'), array('word2')), array('author:"word1 word2"', array('word1 word2'), null), array("author:'word1 word2'", array('word1 word2'), null), -- cgit v1.2.3