How can you filter or alter the search terms that users enter into a search field? Is there a hook available?
The idea is to use this function to filter out 2-3 letter "filler" words ("on", "and", "the", etc.)
function prepSearchStr($str){
$str=preg_replace('©[^a-zA-Z0-9]©', ' ', $str);
$str=preg_replace('©(?<=\s|^)(([a-zA-Z]{1,3})|[0-9]{1,2})(?=\s|$)©', ' ', $str); //remove smaller groups of characters
$exploded=explode(' ', $str);
$exploded=array_filter($exploded);
return implode(' ', $exploded);
}
