全文检索:如何按相关性排序?

时间:2011-05-15 19:48:49

标签: sql-server full-text-search relevance

我正在使用全文搜索,在我的网站上,用户通常会搜索几个单词,作者姓名(1-2个单词)和标题(1-3个单词)...

我需要像相关性搜索这样的东西,并且已经尝试使用包含Rank的containsstable,但结果非常糟糕。

此外,我尝试使用ISABOUT所有可能的组合和适当的加权 - 结果还可以,但速度非常差。在4个单词内搜索大约30K的行需要10-20秒。

我的查询是:

ISABOUT (madonna weight(0.1),messina weight(0.1),"madonna and messina" weight(0.2),virgin weight(0.1),"madonna and virgin" weight(0.2),"messina and virgin" weight(0.2),"madonna and messina and virgin" weight(0.3),child weight(0.1),"madonna and child" weight(0.2),"messina and child" weight(0.2),"madonna and messina and child" weight(0.3),"virgin and child" weight(0.2),"madonna and virgin and child" weight(0.3),"messina and virgin and child" weight(0.3),"madonna and messina and virgin and child" weight(0.4))

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

以下简化查询工作正常:

ISABOUT (madonna weight(0.1),messina weight(0.1),virgin weight(0.1),child weight(0.1))

强调组合很好,但这个也很好