SQL全文搜索意外排名 -

时间:2012-09-03 08:40:50

标签: full-text-search sql-server-2008-r2

如果我执行以下全文查询:

 SELECT c.CategoryId As ID
      ,c.Title
      ,KEY_TBL.RANK AS [Rank]
  FROM dbo.Category AS c
  INNER JOIN FREETEXTTABLE(dbo.Category, Title, 'back lower pain') AS KEY_TBL ON c.CategoryId = KEY_TBL.[KEY]
  WHERE c.IsActive = 1
  ORDER BY KEY_TBL.RANK DESC

我在类别表中有以下两个条目

ID | Title      | Rank
-----------------------
12 | Lower Body | 34  
11 | Back Pain  | 34

我原本以为给定“背部疼痛”会匹配三个单词中的两个,它会比“下半身”排名更高但是情况并非如此,排名相同,我如何构建查询以便排名反映了这个?

不确定这是否相关,但我的全文索引声明为:

    CREATE FULLTEXT INDEX 
    ON [dbo].[Category]
        (Title)
    KEY INDEX [PK_Category_CategoryId]
    ON [FullTextCatalog]
    WITH CHANGE_TRACKING AUTO

0 个答案:

没有答案