Forum Moderators: open
Our site is railroad related, and I started a log of what people are searching for and I'm getting lots of requests like "big boy" (a steam locomotive), EMD, CAB, GG1, etc. They are all returning 0 results when there should be hundreds. My log is showing about 75% failures because of this problem. Any way around this using MySQL?
If you can't go down an alternative route then the answer to your problem may be to improvise, this could be affected by the size of your database. A 'quick and dirty' solution would be to replicate the searchable part of your database with a 3 character string added to every word (e.g big becomes bigxyz) and then do a search for 'bigxyz boyxyz' instead of 'big boy', there are all sorts of reasons why that's not a great solution but it would get around your 4 character issue.
I would suggest that if your hosting set up is causing you problems then moving may be the answer. having to write 'solutions around artificially imposed restrictions is not the way forward. If you are having an issue with full text search then I'd guess that many other issues will crop up and cause you to spend more time than need be (hence making it more efficieant to just pay more for your hosting than spending hours more on every bit of coding). Moving to a host that gives you more control means you can use the wealth of advice that's out there without having to engineer your way around restrictions, an example is that a really good full text search solution to your problem could be up and running in less time than some people take for lunch.
Anyway, the point I'm making is I have a website that "at this time" is just about breaking even. Would I like a dedicated server? Sure! But sometime you just have to make do with what you can afford and if jerry-rigging will get you through it until things do start clicking, than that is what I have no choice but to do.
Really, I do appreciate the "do it right the first time" response, but it's not always possible. We've got a ton of data in our MySQL databases, they're working extremely well, I know how to work with it, and the access is lightning fast including search terms that are > 3 characters and I was just hoping there would be some kind of tweak or method of creating a secondary .ini file I can get MySQL to recognize that will lower the word count setting.
1. run services.msc to check what .ini your mysql is reading (in my case, "C:\MySQL\bin\mysqld-nt" --defaults-file="C:\MySQL\my.ini" MySQL)
2. change your my.ini like this:
[mysqld]
ft_min_word_len=3
ft_stopword_file="C:\\MySQL\\stop.txt"
3. restart your mysqld at services.msc
4. reindex your table using REPAIR TABLE tbl_name QUICK;