mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-31 08:54:17 +00:00
remove single char words
This commit is contained in:
parent
e16a7b8171
commit
1c5346bc07
@ -81,6 +81,19 @@ class Filter {
|
||||
|
||||
if ($mode == 'default') {
|
||||
|
||||
// Remove single char words
|
||||
$words = [];
|
||||
foreach ((array) explode(' ', $query) as $word) {
|
||||
|
||||
if (mb_strlen($word) > 1) {
|
||||
$words[] = $word;
|
||||
}
|
||||
}
|
||||
|
||||
if ($words) {
|
||||
$query = implode(' ', $words);
|
||||
}
|
||||
|
||||
// Remove SphinxQL special chars
|
||||
$query = str_replace(['\\', '/', '~', '@', '!', '"', '(', ')'], ['\\\\', '\/', '\~', '\@', '\!', '\"', '\(', '\)'], $query);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user