0

我基本上是在尝试创建搜索以查找文章(或作者的文章)。我结束了这个查询:

   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`

我确保所有四个匹配的字段都是全文索引。搜索匹配并找到由名字为“Kevin”的用户撰写的所有文章,但如果我搜索名为“Test”(存在)的文章,则不会匹配。

4

1 回答 1

0

Match against不会为“停止”词找到分数。

停用词是出现在 50% 以上的结果中的词,
或者在官方停用词列表™ 中的词。

请参阅:http
://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html 和: http: //dev.mysql.com/doc/refman/5.5/en/fulltext-search.html

有关微调匹配,请参阅:http ://dev.mysql.com/doc/refman/5.5/en/fulltext-fine-tuning.html

于 2011-05-08T03:28:27.233 回答