Forums

Change minimum length of words in MYSQL FULLTEXT search

Hey, I developed a political search engine which demands to search for party abbreviations (PSE, SPD, ABC...) or topics i.e. NSA etc. I use a FULLTEXT search which only allows for words with a minimal length of 4. To change the minimum length, I got to set variable ft_min_word_len = 3 in MySQL. The var is read_only, most probably for good reasons. Is there however anything I can do?

Hm, I don't think we can change that variable without changing it system-wide... Is there any way of setting it on a per-table basis?

That's what I thought. There is a work-around, by simply applying a normal like "%%" search for three-letter searchterms, with all its disadvantages, but probably an acceptable trade-off to finding nothing at all. Unfortunately, I am not aware of another more limited solution. Thanks for the quick answer though!

No problem. Glad there's a workaround, even if it is a bit sub-optimal!