Forum Moderators: coopster
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('MySQL');
How would I go about telling if a word has been excluded because it is too common, or because it was not found?
If you are on MySQL Version 4.0.1 you can use the IN BOOLEAN MODE modifier:
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+MySQL' IN BOOLEAN MODE);
Now, you might be thinking, "Well, I can't be running a search over my entire database twice every time I get no result set returned! That would be way too intensive." True. Then you may want to offer an Advanced Search on your search page so your user can force a find on certain words. You know, an input field stating, "Search must return words:" and then you would prepend the plus sign to the text string entered by the user prior to running your database search.
Or, you may want to use a different approach altogether ;)
[edited by: jatar_k at 8:18 pm (utc) on Dec. 5, 2003]
[edit reason] changed wmv to w m w [/edit]