diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php index f43a6eda2..83a2add2d 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php @@ -85,12 +85,12 @@ class ThirdPartyApiSearch implements SearchApiInterface $pertinenceArgs = []; foreach ($strs as $str) { - if (!empty($str)) { - $wheres[] = "(LOWER(UNACCENT(?)) <<% tparty.canonicalized OR + if ('' !== trim($str)) { + $wheres[] = "((LOWER(UNACCENT(?)) <<% tparty.canonicalized OR tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%') OR (LOWER(UNACCENT(?)) <<% parent.canonicalized OR - parent.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%') + parent.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')) "; $whereArgs[] = [$str, $str, $str, $str]; $pertinence[] = 'GREATEST(