Link to home
Start Free TrialLog in
Avatar of coolispaul
coolispaulFlag for United States of America

asked on

MYSQL Fulltext fine-tuning

Hi

I want to change the default limit on string length that fulltext seraches from 4 to 3
how can i do this from the command line or how is it done in general?
Avatar of akshah123
akshah123
Flag of United States of America image

You can do that by setting the variable
ft_min_word_len
in your config file for the mysql server.
Avatar of coolispaul

ASKER

i have tried changing the value, restarting mysql and repairing the table but to no avail
How did u change value?  If you changed it and restarted the mysql server, does it still keep the new value?
Also, you need to rebuild the index.  Repair table does not necesarily do that.  Try dropping and re-creating the full text index.
hi,

how can i see the value?
i tried using "show variables like %ft_min_word_len" but nothing showed.
i added ft_min_word_len = 3 to "my.cnf" file on server - is this right?
i did repair the table and restart the mysql server too

In order to see the variable value you need to include it in single or double quotes.  Try ...

show variables like 'ft_min_word_len';

>>i did repair the table and restart the mysql server too
This alone would not help.  You will need to rebuild the index.  I believe the best thing would be to drop the index and then recreate it.
Hi,

Ok i will try redoing the index.

Could you help me find out what the server thinks ft_min_word_len is?

I tried - show variables like 'ft_min_word_len'; but got an empty set so i then tried
show variables;

but didnt see that variable in the list.

Thanks
Which version of mysql are you using?  This variable was added as of mysql 4.0
3.23.58

Does this mean i cannot change the default min word len?
Fulltext does work in this version of mysql though

ASKER CERTIFIED SOLUTION
Avatar of akshah123
akshah123
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok thanks. I will look into doing this - is it easy enough and will this have any impact on websites that already use this version?
>>>is it easy enough and will this have any impact on websites that already use this version?
Its easy if you know the OS where you are installing it.  The impact depends on your usage mysql.  It is possible, you might be using a deprecated function or a name for a table that is now a reserved word.  I suggest you take a look at the upgrade instructions for the version you wish to upgrade to.
For 5.0, checkout following section ...
http://dev.mysql.com/doc/refman/5.0/en/installing.html