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