Page 1 of 1

Fulltext Search

Posted: Sat Mar 27, 2004 10:05 pm
by boone
I was working on making my own customized theme today, and I noticed this code in the default theme's layout.php:

Code: Select all

if ( strlen($serendipity['GET']['searchTerm']) <= 3 ) {
   echo SEARCH_TOO_SHORT;
   break;
}
I understand that the default MySQL fulltext word size is 4 or more characters, but this is adjustable in MySQL 4.x. Shouldn't this code instead compare to the value of the MySQL variable 'ft_min_word_len'? Or possibly have a constant defined somewhere, not just a hardcoded 3.

Not a big deal, just trying to help improve s9y.

Posted: Mon Mar 29, 2004 5:58 am
by boone
In addition, the search term should probably first be broken into its component words, then tested for length. If I try to search for 'php net', Serendipity won't complain about the length of the search term, but it still won't return results (assuming the default MySQL settings).

Posted: Sat Apr 03, 2004 7:31 pm
by munk
Create a patch if you're able and submit it to the developers on the mailing list, it may well get added! :P