I'm writing some code to automatically tag some articles.
I have an array of tags and a table of articles. I run the following query to check for headlines matching a tag:
SELECT headline
FROM `news`
WHERE MATCH(headline) AGAINST ("+Green +Day" IN BOOLEAN MODE)
This finds all articles with the exact phrase 'Green Day' in the headline - without the first +, I get articles that contain just the word 'Green'.
This isn't perfect and some tags result in inaccurate results - eg a tag called Die! Die! Die!
(don't ask) returns every headline with the word 'die' in it.
Is there something obvious I'm missing here? All I want is to get headlines which contain the entire phrase, in the exact way it's entered.