mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-24 13:34:25 +00:00
change query separators to the MAYBE operator in default search mode
This commit is contained in:
parent
9379809261
commit
e1fb7f8c17
@ -80,7 +80,14 @@ class Filter {
|
||||
static public function searchQuery(string $query, string $mode = 'default') {
|
||||
|
||||
if ($mode == 'default') {
|
||||
|
||||
// Remove SphinxQL special chars
|
||||
$query = str_replace(['\\', '/', '~', '@', '!', '"', '(', ')'], ['\\\\', '\/', '\~', '\@', '\!', '\"', '\(', '\)'], $query);
|
||||
|
||||
// Replace query separators to the MAYBE operator
|
||||
$query = str_replace(['.', ',', ':', ';'], ' ', $query);
|
||||
$query = preg_replace('/[\s]+/', ' ', $query);
|
||||
$query = str_replace(' ', ' MAYBE ', $query);
|
||||
}
|
||||
|
||||
$query = trim($query);
|
||||
|
Loading…
x
Reference in New Issue
Block a user