File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 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
1414
1515- Correclty handle Search result with NoContent flag ([ Issue #9 ] , [ Issue #10 ] , [ PR #13 ] )
1616- Don't double % in fuzzy search ([ Issue #11 ] , [ PR #14 ] )
17+ - Fix exact match not used inside text facet ([ Issue #12 ] , [ PR #15 ] )
1718
1819## [ 1.3.0]
1920
@@ -110,8 +111,10 @@ First version
110111[ Issue#9 ] : https://github.com/MacFJA/php-redisearch/issues/9
111112[ Issue#10 ] : https://github.com/MacFJA/php-redisearch/issues/10
112113[ Issue#11 ] : https://github.com/MacFJA/php-redisearch/issues/11
114+ [ Issue#12 ] : https://github.com/MacFJA/php-redisearch/issues/12
113115[ PR#1 ] : https://github.com/MacFJA/php-redisearch/pull/1
114116[ PR#3 ] : https://github.com/MacFJA/php-redisearch/pull/3
115117[ PR#8 ] : https://github.com/MacFJA/php-redisearch/pull/8
116118[ 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 2323
2424use MacFJA \RediSearch \Helper \EscapeHelper ;
2525use function sprintf ;
26+ use function strpos ;
2627
2728class ExactMatch implements PartialQuery
2829{
@@ -36,6 +37,10 @@ public function __construct(string $match)
3637
3738 public function render (): string
3839 {
40+ if (false === strpos ($ this ->match , ' ' )) {
41+ return EscapeHelper::escapeWord ($ this ->match );
42+ }
43+
3944 return sprintf ('"%s" ' , EscapeHelper::escapeExactMatch ($ this ->match ));
4045 }
4146
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function render(): string
5353 {
5454 if (count ($ this ->orValues ) > 1 ) {
5555 $ terms = OrGroup::renderNoParentheses (...array_map (function (string $ orValue ) {
56- return new Word ($ orValue );
56+ return new ExactMatch ($ orValue );
5757 }, $ this ->orValues ));
5858
5959 return sprintf (self ::WITH_SPACE_PATTERN , EscapeHelper::escapeFieldName ($ this ->field ), $ terms );
You can’t perform that action at this time.
0 commit comments