【问题标题】:MySQL Join and Match/Against Search FailMySQL 加入和匹配/反对搜索失败
【发布时间】:2011-05-08 03:14:54
【问题描述】:

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

   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`

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

【问题讨论】:

    标签: mysql sql full-text-search match-against


    【解决方案1】:

    匹配将不会为“停止”词找到分数。

    停用词是出现在 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

    有关微调 Match Against 的信息,请参阅:http://dev.mysql.com/doc/refman/5.5/en/fulltext-fine-tuning.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      相关资源
      最近更新 更多