Fulltext Search

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
boone
Regular
Posts: 16
Joined: Sat Jan 17, 2004 3:09 am
Contact:

Fulltext Search

Post 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.
boone
Regular
Posts: 16
Joined: Sat Jan 17, 2004 3:09 am
Contact:

Post 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).
munk
Regular
Posts: 15
Joined: Tue Dec 09, 2003 6:25 pm
Contact:

Post 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
Post Reply