public function split_keywords(&$keywords, $terms)
{
if ($terms == 'all') {
$match = array('#\\sand\\s#i', '#\\sor\\s#i', '#\\snot\\s#i', '#\\+#', '#-#', '#\\|#', '#@#');
$replace = array(' & ', ' | ', ' - ', ' +', ' -', ' |', '');
$replacements = 0;
$keywords = preg_replace($match, $replace, $keywords);
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
} else {
$this->sphinx->SetMatchMode(SPH_MATCH_ANY);
}
// Keep quotes and new lines
$keywords = str_replace(array('"', "\n"), array('"', ' '), trim($keywords));
if (strlen($keywords) > 0) {
$this->search_query = str_replace('"', '"', $keywords);
return true;
}
return false;
}