views:

61

answers:

2

I am using FULLTEXT as index in a textfield in mysql. This so that I can do FULLTEXT searches later on.

The default value of a FULLTEXT nr of characters is 4. This is changed in this line inside the my.cnf or my.ini file:

 [mysqld]
 ft_min_word_len=4

According to my webhosting company (one.com) they don't KNOW the value, AND it's IMPOSSIBLE to change it. I have contacted them several times, but thats what they say.

So my Q is, does any webhoster allow to change this? and if so, how?

OR, should I consider changing the FULLTEXT to something else and work around it somehow?

Thanks

UPDATE:

Check this link: http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html

If I have a search query, and the string contains 2 letters, You cant search a FULLTEXT index with ft_min_word_len=4, because it will ignore all strings with more characters than that value...

UPDATE2

I want to be able to search whole words in a mysql table field. When I use the 'LIKE' statement, if I have a field value of 'mercedes' and if I only write 'merc' it will give the 'mercedes' field as a result... I want to only match whole words.

+1  A: 

This is a mySQL configuration setting that, if changed, would affect the whole server. It's very unlikely your provider is going to change it for you. If you really need it changed, consider renting a server like Carl Smotricz recommends.

Pekka
okay, check my update again then please...
Camran
I will create a new question Pekka...
Camran
All right.-----
Pekka
+2  A: 

In the specific case of your Web hoster, it looks like they simply don't want to change the value. Maybe your MySQL instance is shared with other accounts on the same box?

I pay roughly $60 for my own root server, which I have all to myself, and the whole dang thing is my playground; I can exchange the entire operating system if I want to. Depending on the application, though, it makes sense to go for a less expensive plan. There are various "virtual hosting" server hosting offers, where you get what looks to you like a root server but is in fact a virtual machine. You get to play with everything, even as root, but you don't get the whole box's resources. I can get a plan like that for about $13 a month, maybe less if I shop around.

As for your specific requirement of reducing ft_whatzit: Please consider that this is probably a very bad idea. There's a reason the default minimum is 4. There are many, many 2-letter words that don't contribute any value to your full text index but contribute enormously to its size. Essentially, with the threshold set so low, your index becomes roughly as (in)efficient to search as the original text, and there goes the advantage of full text searching.

The sensible way to do this kind of thing is: When someone asks you to find some words, use only those words ft_min_word_len in length or longer in the search, ignore the tiny words; then retrieve and scan through the full texts you get from that, and discard any that happen not to contain your tiny words. If someone's search contains only words of 3 characters or less, tell them no, for efficiency reasons, or directly scan the full text of every text if you want to be nice and they insist.

Carl Smotricz
That is not possible in my case since it's a classifieds website and searches for car brands like BMW must be enabled... But I get what you are saying so I will probably work around this in another way, without FULLTEXT... Thanks
Camran
That's why I added the "if you want to be nice and they insist" option. Glad I was able to help a bit.
Carl Smotricz