JD Isaacks
JD Isaacks

Reputation: 58004

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 entries 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?

Upvotes: 0

Views: 109

Answers (2)

peterfh
peterfh

Reputation: 83

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

Upvotes: 0

Pascal MARTIN
Pascal MARTIN

Reputation: 401152

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...

Upvotes: 1

Related Questions