Can I change “ft_min_word_len” on shared hosting?

前提是你 提交于 2019-12-19 16:55:14

问题


I have MySQL on shared hosting. Is there any way how to change value of ft_min_word_len without administrator access?

I found one workaround, where every word that has less than 4 characters is supplemented with _ or some other char, and the same is done with every searched keyword that is less than 4 characters.

Is there any better, or cleaner way to make Fulltext search work for short words?


回答1:


Unfortunately, ft_min_word_len is a global system variable and cannot be set dynamically: see MySQL's online docs. Changing it would mean rebuilding every FULLTEXT index around, btw, so you can see why they don't want non-admins to mess with it.

I fear your workaround (or something entirely equivalent) is the only way to solve the problem in your situation. Sorry! (But, compliments for thinking of it!).




回答2:


I know this is an old post but if someone has shell access to the server (even as non root) and mysql client tools you could do

myisamchk --recover --ft_min_word_len=2 mytable.MYI

Anyway you propably have to schedule this to run every day to include new values, too.



来源:https://stackoverflow.com/questions/1024456/can-i-change-ft-min-word-len-on-shared-hosting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!