128 public static function matchAgainstWildcard($phrase, $leftWildcard =
'+' , $rightWildcard =
'*', $minTokenSize =
null)
130 $ftMinTokenSize = $minTokenSize ?: \Bitrix\Main\ORM\Query\Filter\Helper::getMinTokenSize();
135 $andValues = \Bitrix\Main\ORM\Query\Filter\Helper::splitWords($phrase);
137 if(!empty($andValues))
139 $andValues = array_filter(
141 static function($val) use ($ftMinTokenSize)
143 return (mb_strlen($val) >= $ftMinTokenSize);
147 if(!empty($andValues))
149 $orValues[] = $leftWildcard . implode($rightWildcard .
" " . $leftWildcard, $andValues) . $rightWildcard;
153 if(!empty($orValues))
155 return "(".implode(
") (", $orValues).
")";