全文搜索在噪声字上使用Freetexttable失败 - SQL Server 2008 R2转换噪声字无效 [英] Full-text Search Using Freetexttable Failing on Noise Words - SQL Server 2008 R2 Transform Noise Words not working

查看:279
本文介绍了全文搜索在噪声字上使用Freetexttable失败 - SQL Server 2008 R2转换噪声字无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2008 R2和freetexttable运行我的网站的全文搜索。输入停用词时出现此错误:

I am running a full-text search for my site using SQL Server 2008 R2 and freetexttable. I am getting this error when a stop word is entered:


信息:全文搜索条件包含噪音词。 / b>

Informational: The full-text search condition contained noise word(s).

因此,我做了大家都说过的事情,并打开了变换噪音词,以便停止/噪音词被忽略,并且查询可以继续。但是这并没有改变:

So I did what everyone said to do and turned on the Transform Noise Words so the stop/noise words are ignored and the query can continue. But this changed nothing:

sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'transform noise words', 1;
RECONFIGURE;
GO

我仍然收到相同的错误讯息。所以现在我唯一的选择是关闭停止列表,但这是不好的,因为如果有人在搜索中放置the,它将返回所有页面,因为每个页面中都有the。我想删除停用词,但是SQL Server 2008 R2并不适合我。

I still get the same error message. So right now my only option is to turn off the stop list, but that is bad because if someone puts "the" in their search it will return ALL pages because every page pretty much has "the" in it. I want the stop words removed, but SQL Server 2008 R2 is not working for me.

任何人都可以在2008 R2中使用它吗?我的兼容性级别已经是100。

Has anyone actually gotten this to work in 2008 R2? My compatibility level was already 100.

有没有什么方法可以让停用词被忽略而不被索引?

Is there any way for me to get stop words to be ignored and not indexed?

推荐答案

我很感激这已经很晚了,它可能会帮助其他人下线。

I appreciate this is very late it might help someone else down the line.

创建一个基于系统停止列表;这将创建一个新的stoplist,包含系统列表中的所有单词(您无法在2008 + sql中修改该单词)。

Create a newstoplist based on the system stoplist; this creates a new stoplist with all the words in the system stoplist (which you can't amend in 2008+ sql)

CREATE FULLTEXT STOPLIST slMyNewStopList
FROM SYSTEM STOPLIST AUTHORIZATION dbo;

然后我检查了新的专题列表是否正确创建;

I then checked the new spotlist was created correctly;

select * from sys.fulltext_stoplists
select * from sys.fulltext_stopwords

在我的例子中,新的列表是ID 6。因为人们希望能够在数据中搜索IT功能。所以我检查了这样的目录中的单词;

In my case the new stoplist was ID 6. The word I wanted to remove was it; as people wanted to be able to search for "IT Function" in data. So I checked the words in the catalog like this;

select * from sys.fulltext_stopwords
where stoplist_id = 6 and stopword = 'it' and language like '%english%'

需要调用系统函数;我删除了英文和英文英文。在这一点上你必须有分号。

To remove a word from the stoplist you need to call a system function; i removed it for English and British English. You have to have the semi colons at this point.

ALTER FULLTEXT STOPLIST slMyNewStopList DROP 'it' LANGUAGE 'English';

ALTER FULLTEXT STOPLIST slMyNewStopList DROP 'it' LANGUAGE 'British English';

然后我通过再次运行select查询来确认单词从我的列表中缺失

I then confirmed the word was missing from my stoplist by running the select query again

select * from sys.fulltext_stopwords
where stoplist_id = 6 and stopword = 'it' and language like '%english%'

然后我更新了我希望能够搜索IT词汇的表格;

I then updated the table I wanted to be able to search for IT words on;

USE [Database]
GO
ALTER FULLTEXT INDEX ON [dbo].[tblDocuments] SET STOPLIST = [slMyNewStopList]

最后,我重建了目录,以便将文档重新编制索引。

Finally I rebuilt the catalog so the documents were all reindexed.

USE [Database]
GO
ALTER FULLTEXT CATALOG [catExample] REBUILD
GO

这篇关于全文搜索在噪声字上使用Freetexttable失败 - SQL Server 2008 R2转换噪声字无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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