protected function fullTextWildcards($term)
    {
        // removing symbols used by MySQL
        $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];
        $term = str_replace($reservedSymbols, '', $term);

        $words = explode(' ', $term);

        foreach ($words as $key => $word) {
            /*
             * applying + operator (required word) only big words
             * because smaller ones are not indexed by mysql
             */
            if (strlen($word) >= 3) {
                // $words[$key] = '+' . $word . '*';
                $words[$key] = $word.'*';
            }
        }

        $searchTerm = implode(' ', $words);

        return $searchTerm;
    }
protected function fullTextWildcards($term)
    {
        // removing symbols used by MySQL
        $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];
        $term = str_replace($reservedSymbols, '', $term);

        $words = explode(' ', $term);

        foreach ($words as $key => $word) {
            /*
             * applying + operator (required word) only big words
             * because smaller ones are not indexed by mysql
             */
            if (strlen($word) >= 3) {
                // $words[$key] = '+' . $word . '*';
                $words[$key] = $word.'*';
            }
        }

        $searchTerm = implode(' ', $words);

        return $searchTerm;
    }
protected function fullTextWildcards ( $ term ) { // removing symbols used by MySQL $ reservedSymbols = [ '-' , '+' , '<' , '>' , '@' , '(' , ')' , '~' ] ; $ term = str_replace ( $ reservedSymbols , '' , $ term ) ; $ words = explode ( ' ' , $ term ) ; foreach ( $ words as $ key => $ word ) { /*
             * applying + operator (required word) only big words
             * because smaller ones are not indexed by mysql
             */ if ( strlen ( $ word ) >= 3 ) { // $words[$key] = '+' . $word . '*'; $ words [ $ key ] = $ word . '*' ; } } $ searchTerm = implode ( ' ' , $ words ) ; return $ searchTerm ; }
Replaces spaces with full text search wildcards

@param string $term
@return string
Replaces spaces with full text search wildcards