Skip to content

Commit 4327e68

Browse files
committed
Remove min_character limit for Comb-powered queries. References statamic/ideas#472.
1 parent 3e2a1b1 commit 4327e68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Search/Comb/Comb.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Comb
4040
* Minimum characters to search over.
4141
* @var int
4242
*/
43-
private $min_characters = 3;
43+
private $min_characters = 1;
4444

4545
/**
4646
* Minimum characters per word to include word in search.
@@ -659,8 +659,8 @@ private function searchOverData($params, $raw_query)
659659
*/
660660
private function removeDisallowedMatches($params)
661661
{
662-
$disallowed = '#'.join('|', $params['disallowed']).'#i';
663-
$required = '#(?=.*'.join(')(?=.*', $params['required']).')#i';
662+
$disallowed = '#'.implode('|', $params['disallowed']).'#i';
663+
$required = '#(?=.*'.implode(')(?=.*', $params['required']).')#i';
664664
$new_data = [];
665665

666666
// this only applies to boolean mode
@@ -1007,6 +1007,6 @@ public static function create($data, $config)
10071007
unset($config['limit']);
10081008
}
10091009

1010-
return new Comb($data, $config);
1010+
return new self($data, $config);
10111011
}
10121012
}

0 commit comments

Comments
 (0)