If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > fulltext search help needed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-17-05, 20:20
madeonmoon madeonmoon is offline
Registered User
 
Join Date: Oct 2003
Posts: 15
fulltext search help needed

Hello all,

I have two identical queries (see below) and for some reason the first one returns data while the second does not (empty result set). Note, the database does contain data to return in both cases.

Can someone shed some light on it? Thanks a lot!

1) SELECT field1, field2, field3 FROM mytb WHERE match(field1,field2) against('mysql' IN BOOLEAN MODE)

2) SELECT field1, field2, field3 FROM mytb WHERE match(field1,field2) against('php' IN BOOLEAN MODE)
Reply With Quote
  #2 (permalink)  
Old 10-17-05, 21:05
madeonmoon madeonmoon is offline
Registered User
 
Join Date: Oct 2003
Posts: 15
I think I've answered my own question now. fulltext feature won't index search terms shorter than 4 characters long (hence 'PHP' search term does not work).

Does anyone know if this is configurable?

Thanks,
James
Reply With Quote
  #3 (permalink)  
Old 10-20-05, 16:32
khibinite khibinite is offline
Registered User
 
Join Date: Oct 2003
Posts: 63
Sure, you may change the maximum length of words for fulltext search. Let me quote the mysql reference manual:

The minimum and maximum length of words to be indexed is defined by the ft_min_word_len and ft_max_word_len system variables (available as of MySQL 4.0.0). See Section 5.2.3, “Server System Variables”. The default minimum value is four characters. The default maximum depends on your version of MySQL. 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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On