问题
I'm basically trying to create a search to find articles (or articles from an author). I've ended up with this query:
SELECT `articles`.*, `authors`.*
FROM `articles`
LEFT JOIN `authors` ON (`authors`.`id` = `articles`.`author_id`)
WHERE MATCH (`articles`.`title`, `articles`.`description`)
AGAINST ("test")
OR MATCH (`authors`.`first_name`, `authors`.`last_name`)
AGAINST ("test")
GROUP BY `articles`.`id`
I have made sure that all four matched fields are FULL TEXT indexes. The search matches against and finds all articles made by a user with first name 'Kevin' but will not match if I search for articles named 'Test' (which exists).
回答1:
Match against will not find a score for "stop" words.
Stop words are words that occur in 50%+ of the results,
or that are in the official stop word list™.
See: http://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html
And: http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html
For finetuning Match Against see: http://dev.mysql.com/doc/refman/5.5/en/fulltext-fine-tuning.html
来源:https://stackoverflow.com/questions/5925369/mysql-join-and-match-against-search-fail