Min number of search characters for mysql search back end

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
Wert
Registered User
Posts: 400
Joined: Tue Jul 03, 2001 8:33 pm

Min number of search characters for mysql search back end

Post by Wert »

I set up a test forum, set search settings to - Fulltext mysql

Kept the following enabled - Fulltext native -> Enable fulltext updating

Deleted the fulltext native index and created Fulltext mysql (active) index

Posted and noted that whatever I do, I cannot get the Fulltext mysql (active) index to index or bring up anything less then 5 character words.

For example, I try to search for the word "home" and I get this:
The following words in your search query were ignored: home
You must specify at least one word to search for. Each word must consist of at least 4 characters and must not contain more than 254 characters excluding wildcards.


It works with the native fulltext, so is there something I'm doing wrong here? Am I missing a setting? Is the a limitation of the Fulltext mysql indexing? I'd like to be able to index 4 letter words and more with Fulltext mysql, but I'm having no luck here at all.
Need good web hosting? I recommend Hostrocket.

TrevorB
Registered User
Posts: 34
Joined: Fri Jan 21, 2005 6:06 am

Re: Min number of search characters for mysql search back end

Post by TrevorB »

The minimum and maximum lengths of words to be indexed are defined by the ft_min_word_len and ft_max_word_len system variables. (See Section 5.2.3, “System Variables”.) The default minimum value is four characters; the default maximum is version dependent. If you change either value, you must rebuild your FULLTEXT indexes. For example, if you want three-character words to be searchable, you can set the ft_min_word_len variable by putting the following lines in an option file:

[mysqld]
ft_min_word_len=3

Then you must restart the server and rebuild your FULLTEXT indexes. Note particularly the remarks regarding myisamchk in the instructions following this list.

http://dev.mysql.com/doc/refman/5.0/en/ ... uning.html

Wert
Registered User
Posts: 400
Joined: Tue Jul 03, 2001 8:33 pm

Re: Min number of search characters for mysql search back end

Post by Wert »

Interesting. So it seems this won't be adjustable from the control panel then?

If not, how would one edit the beta to search 3-4 characters?

Is the mysql fulltext supposed to respect the settings for min and max characters from the admin panel? If not, why not? Bug?
Need good web hosting? I recommend Hostrocket.

User avatar
Eelke
Registered User
Posts: 606
Joined: Thu Dec 20, 2001 8:00 am
Location: Bussum, NL
Contact:

Re: Min number of search characters for mysql search back end

Post by Eelke »

Because, apparently, these are MySQL system settings, not a per-query type thing. I wouldn't want application software go poking around in my database settings that might be used by other applications as well.

However, it does look like the message is about native searching. Maybe that should be changed. It'd be nice if the active settings were extracted from the database, and a message was built from that.

Post Reply