FREETEXTTABLE的排名总是为0 [英] FREETEXTTABLE always has a rank of 0

查看:292
本文介绍了FREETEXTTABLE的排名总是为0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是SQLServer 2008,如果我执行以下查询:

  SELECT 
*
FROM
FREETEXTTABLE(SomeTable,Name,'我知道存在的名字')

我得到了我期望的行,但排名总是0。



寻找解决这个问题的办法,我在Microsoft ASP.NET论坛上发现了这个问题,果然如果我添加:

  ALTER FULLTEXT目录MyCatalog REBUILD 

我开始以获得排名 - 但只是暂时的。

我不想每次搜索时重新编制目录,特别是当我有大量数据时数据库,如果我直接在查询之前将它添加到我的Sproc中,我的查询无论如何都不会返回任何结果,这可能是因为目录已完成重建。似乎还有其他人有这个和类似的问题,但我一直无法找到解决方案。任何想法?

解决方案

排名相对于查询中返回的其他结果,因此仅用于排序相关性返回的值。 有关排名方法的详细信息


I'm using SQLServer 2008 and if I perform the following query:

SELECT 
  *
FROM
  FREETEXTTABLE(SomeTable, Name, 'a name that I know exists')

I get the rows back that I would expect, but the rank is always 0.

Searching for a solution to this problem, I found this question on the Microsoft ASP.NET forum, and sure enough if I add:

ALTER FULLTEXT CATALOG MyCatalog REBUILD

I start to get a rank - but only temporarily.

I don't want to have to rebuild my catalog every time I do a search especially when I have lots of data in my database and if I add it to my Sproc directly before the query, my query returns no results anyway, presumably because the catalog has finished being rebuilt. There seem to be other people having this and similar problems but I have been unable to find a solution. Any ideas?

解决方案

The rank is relative to the other results returned in the query and is therefore only useful for sorting on relevance from the returned values. There is detailed information on the ranking method.

这篇关于FREETEXTTABLE的排名总是为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆