forked from fa/breadcrumb-the-shire
agent foundation
This commit is contained in:
@@ -4,6 +4,8 @@ namespace MintyPHP\Support\Search;
|
||||
|
||||
class SearchQueryNormalizer
|
||||
{
|
||||
// Prepares a user query for SQL LIKE. Escapes \ and _ (LIKE special chars),
|
||||
// converts * to %, and wraps with % wildcards if not already present.
|
||||
public static function normalizeLikeQuery(string $query): string
|
||||
{
|
||||
$query = trim($query);
|
||||
@@ -25,6 +27,7 @@ class SearchQueryNormalizer
|
||||
return $query;
|
||||
}
|
||||
|
||||
// Strips wildcard chars for relevance scoring — score queries need a clean term, not a LIKE pattern.
|
||||
public static function normalizeScoreQuery(string $query): string
|
||||
{
|
||||
$query = trim($query);
|
||||
|
||||
Reference in New Issue
Block a user