File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
15
15
- Correclty handle Search result with NoContent flag ([ Issue #9 ] , [ Issue #10 ] , [ PR #13 ] )
16
16
- Don't double % in fuzzy search ([ Issue #11 ] , [ PR #14 ] )
17
+ - Fix exact match not used inside text facet ([ Issue #12 ] , [ PR #15 ] )
17
18
18
19
## [ 1.3.0]
19
20
@@ -110,8 +111,10 @@ First version
110
111
[ Issue#9 ] : https://github.com/MacFJA/php-redisearch/issues/9
111
112
[ Issue#10 ] : https://github.com/MacFJA/php-redisearch/issues/10
112
113
[ Issue#11 ] : https://github.com/MacFJA/php-redisearch/issues/11
114
+ [ Issue#12 ] : https://github.com/MacFJA/php-redisearch/issues/12
113
115
[ PR#1 ] : https://github.com/MacFJA/php-redisearch/pull/1
114
116
[ PR#3 ] : https://github.com/MacFJA/php-redisearch/pull/3
115
117
[ PR#8 ] : https://github.com/MacFJA/php-redisearch/pull/8
116
118
[ PR#13 ] : https://github.com/MacFJA/php-redisearch/pull/13
117
- [ PR#14 ] : https://github.com/MacFJA/php-redisearch/pull/14
119
+ [ PR#14 ] : https://github.com/MacFJA/php-redisearch/pull/14
120
+ [ PR#15 ] : https://github.com/MacFJA/php-redisearch/pull/15
Original file line number Diff line number Diff line change 23
23
24
24
use MacFJA \RediSearch \Helper \EscapeHelper ;
25
25
use function sprintf ;
26
+ use function strpos ;
26
27
27
28
class ExactMatch implements PartialQuery
28
29
{
@@ -36,6 +37,10 @@ public function __construct(string $match)
36
37
37
38
public function render (): string
38
39
{
40
+ if (false === strpos ($ this ->match , ' ' )) {
41
+ return EscapeHelper::escapeWord ($ this ->match );
42
+ }
43
+
39
44
return sprintf ('"%s" ' , EscapeHelper::escapeExactMatch ($ this ->match ));
40
45
}
41
46
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function render(): string
53
53
{
54
54
if (count ($ this ->orValues ) > 1 ) {
55
55
$ terms = OrGroup::renderNoParentheses (...array_map (function (string $ orValue ) {
56
- return new Word ($ orValue );
56
+ return new ExactMatch ($ orValue );
57
57
}, $ this ->orValues ));
58
58
59
59
return sprintf (self ::WITH_SPACE_PATTERN , EscapeHelper::escapeFieldName ($ this ->field ), $ terms );
You can’t perform that action at this time.
0 commit comments