开发者

Is there any way to turn off the 50% gotcha on fulltext search?

I am trying to build a product search for a jewelry store. I know that if a term is in over 50% of the entri开发者_开发技巧es then it has a weight of zero. So right now if I do a search for "diamond" I get no results because over 50% contain diamond. Is there a way to change that?


Quoting the documentation of MySQL : 11.9.6. Fine-Tuning MySQL Full-Text Search

If you really need to search for such common words, it would be better to search using IN BOOLEAN MODE instead, which does not observe the 50% threshold.

See : 11.9.2. Boolean Full-Text Searches


The other solution seems to go with patching MySQL's source-code and recompiling -- which is probably not something you want to do...


Another approach, commented on MySQL website, is to use boolean mode only if the fulltext gives no results, but keep in mind that the second search won't sort the results in order of relevance.

11.9.1. Natural Language Full-Text Searches

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜