tags:

views:

52

answers:

2

Hi,

I have a table called 'business' with the following sample data:

Street - 150 N Michigan Ave.
City - Chicago
State - IL
Zip - 60601

When I run a query like

SELECT business.* 
    WHERE MATCH(business.Street, business.City, business.State, business.Zip)
                AGAINST('*150*' IN BOOLEAN MODE)
-- IT WORKS


SELECT business.* 
    WHERE MATCH(business.Street, business.City, business.State, business.Zip)
                AGAINST('*Chicago*' IN BOOLEAN MODE)
-- IT WORKS


SELECT business.* 
    WHERE MATCH(business.Street, business.City, business.State, business.Zip)
                AGAINST('*60601*' IN BOOLEAN MODE)
-- IT WORKS


SELECT business.* 
    WHERE MATCH(business.Street, business.City, business.State, business.Zip)
                AGAINST('*IL*' IN BOOLEAN MODE)
-- DOESNT WORK!!

So what's wrong with the last query?

Any ideas?

+1  A: 

Looks like you're running into the minimum length limit, as stated in the MySQL docs.

Will A
ya as I suspected :( So what's the solution?
Dsyfa
I'm no MySQL guru - but I'd expect that this limit can be changed somewhere - check through server / database / table settings.
Will A
Yes Will you were right.http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.htmlBut this will be a problem in a shared hosting environment where I will not have access to the config files. :( DANG!
Dsyfa
Doesn't look good - time to change your States to the full names. :)
Will A
A: 

Update the ft_min_word_len variable in the my.cnf MySQL configuration file:

[mysqld]
ft_min_word_len=N

Note that afterwards indexes must be rebuilt.

the_void