简体   繁体   English

SQL Server 2008:使用CONTAINS关闭针对全文搜索查询的选择停用词

[英]SQL Server 2008: Turn off select stop words for full text search query using CONTAINS

Have an app that was using Microsoft SQL Server and needed to search data, found that for queries that had been like "series 6" or "series 66" would return results just if they had 'series' and appears 6 was a stopword. 拥有一个正在使用Microsoft SQL Server且需要搜索数据的应用程序,发现对于类似“系列6”或“系列66”的查询,即使它们具有“系列”且显示为6,也将返回结果为停用词。 The app was 2008 but database compatibility level was sql server 2000 (80). 该应用程序是2008,但是数据库兼容性级别是sql server 2000(80)。

So I made backup and restored as new db, changed the compatibility to 100 (Sql Server 2008) and then ran the following: 因此,我进行了备份并还原为新的数据库,将兼容性更改为100(Sql Server 2008),然后运行以下命令:

ALTER DATABASE [TestDB] SET COMPATIBILITY_LEVEL = 100
ALTER FULLTEXT INDEX ON  CandidateResume SET STOPLIST = OFF

I then ran my query again and appears to work: 然后,我再次运行查询,似乎可以正常工作:

SELECT * FROM CandidateResume WHERE CONTAINS(CandidateResume_Resume, '"Series 6"')

My question, Is it possible to turn off just the numbers in the stoplist per table or do we have to do all or nothing? 我的问题是,是否可以只关闭每个表的非索引字表中的数字,还是我们必须做全部或什么都不做?

Here is a description of ALTER FULLTEXT STOPLIST. 是ALTER FULLTEXT STOPLIST的说明。 It looks like you can DROP elements, so you could turn off numbers, but not by table. 看起来您可以删除元素,因此可以关闭数字,但不能按表关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM