Browse Source

update Filter::searchQuery method

main
ghost 1 year ago
parent
commit
61a0652f51
  1. 14
      library/filter.php

14
library/filter.php

@ -113,7 +113,7 @@ class Filter { @@ -113,7 +113,7 @@ class Filter {
'ZONESPAN',
'PARAGRAPH',
'\\', '/', '~', '@', '!', '"', '(', ')', '|', '?', '%', '-', '>', '<', ':', ';'
'\\', '/', '~', '@', '!', '"', '(', ')', '|', '?', '%', '-', '>', '<', ':', ';', '^', '$'
];
foreach ($operators as $operator) {
@ -122,7 +122,17 @@ class Filter { @@ -122,7 +122,17 @@ class Filter {
}
// Apply query semantics
$query = str_replace(' ', ' | ', $query);
// Long queries
// @TODO seems that queries longer than 68 chars cropping
if (mb_strlen($query) > 68) {
$query = sprintf('%s*', substr($query, 0, 67));
} else {
$query = sprintf('"%s" | (%s)', $query, str_replace(' ', ' | ', $query));
}
return trim($query);
}

Loading…
Cancel
Save