Skip to content

Commit

Permalink
Fix search with wildcards and fuzzy keywords (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoek authored Jul 24, 2020
1 parent f556be6 commit fd6fd7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ protected function prepareQuery(string $query): string
foreach ($queryValues as $queryValue) {
if (\strlen($queryValue) > 2) {
$queryString .= '+("' . self::escapeDoubleQuotes($queryValue) . '" OR ' .
'"' . preg_replace('/([^\pL\s\d])/u', '?', $queryValue) . '*" OR ' .
'"' . preg_replace('/([^\pL\s\d])/u', '', $queryValue) . '~") ';
preg_replace('/([^\pL\s\d])/u', '?', $queryValue) . '* OR ' .
preg_replace('/([^\pL\s\d])/u', '', $queryValue) . '~) ';
} else {
$queryString .= '+("' . self::escapeDoubleQuotes($queryValue) . '") ';
}
Expand Down

0 comments on commit fd6fd7f

Please sign in to comment.