In SQL Server 2008 noise files have changed. They are no longer represented within a physical file (noise___.txt), they are now managed in databases by using objects called stoplists.
Here are some points on stoplist:
- A system stoplist (default stoplist) exists that is used by default by all fulltext indexes.
- The system stoplist is readonly and can not be changed.
- For databases with compatibility levels set to 80 and 90, the system stoplist is always assigned.
- To manage your own stoplist (noise file) you will need to ensure your compatibility level is set to 100 (SQL Server 2008).
Here are some steps to migrate your existing noise files to stoplists:
- Change the compatibility level of the database your working with to 100 ‘SQL Server 2008’.
- Create your stoplist (noise file) against your desired database.
CREATE FULLTEXT STOPLIST stoplist_name
FROM SYSTEM STOPLIST
[/SQL]This will create a new stoplist based on the system stoplist.If you have not done step 1 you may get this error: ‘Incorrect syntax near ‘STOPLIST’.’
- Add or drop stopwords:
ALTER FULLTEXT STOPLIST stoplist_name DROP ‘can’ LANGUAGE ‘English’;
- Test your change by checking a search queries tokenization result.Find your stoplist ID.[SQL]
SELECT stoplist_id, name FROM sys.fulltext_stoplists
Find your language ID.
select * from syslanguages
Get the tokenization results.
SELECT special_term, display_term
(‘ “can testing for fruit and nuts, any type of nut” ‘, 1033, 6, 0)
- Set your stoplist to be used by your full text indexs.[SQL]
ALTER FULLTEXT INDEX ON dbo.[Database_Name] SET STOPLIST stoplist_name;
- Rebuild your full text indexes.[SQL]
ALTER FULLTEXT CATALOG [FullTextCatalog_Name] REBUILD
This query to check the details of your fulltext_index. It will list the linkage from your fulltext_index to your fulltext_catalog at stoplist.
SELECT t.name AS [TableName], c.name AS [FTCatalogName], c.fulltext_catalog_id,
i.change_tracking_state_desc, i.stoplist_id, s.name AS [StoplistName]
FROM sys.tables AS t
INNER JOIN sys.fulltext_indexes AS i
ON t.object_id = i.object_id
INNER JOIN sys.fulltext_catalogs AS c
ON i.fulltext_catalog_id = c.fulltext_catalog_id
LEFT OUTER JOIN sys.fulltext_stoplists AS s
ON i.stoplist_id = s.stoplist_id