Wednesday, March 03, 2010

SQL 2008 - enable database for full text search

My customer wanted a search screen to find product information by key words. Up to now I have been using standard SQL server transact-sql. It became clear to me that we needed to look into the full text search because he wanted to find data by relevance.
The database needs to be readied to use full text search.
Set the database to compatibility level server 2008.
Here is the transact SQL:
-- enable full text search on a sql 2008 server - database was restored from sql 2000
USE [master]
GO
-- examine the current compatibility level
EXEC sp_dbcmptlevel 'MyDatabase'
go
-- change the compatibility level
ALTER DATABASE [MyDatabase] SET COMPATIBILITY_LEVEL = 100
GO
Create a stoplist

In case the system stoplist does not contain a stopword that you require

USE MyDatabase
GO
-- find out if a specific stopword is in use
select * from sys.fulltext_stopwords where stopword = 'de'
GO
-- in case the system stoplist is not sufficient, create your own
CREATE FULLTEXT STOPLIST myStoplist FROM SYSTEM STOPLIST;
GO

5 comments:

Little Frog said...

I can't enable full-text search .... :(( :((

ninest123 said...

nike air max, kate spade outlet, nike roshe run, louis vuitton, sac longchamp, oakley sunglasses, nike air max, prada handbags, tiffany and co, ugg boots, ralph lauren pas cher, louis vuitton outlet, jordan shoes, polo ralph lauren outlet, gucci outlet, louboutin outlet, burberry, ray ban sunglasses, longchamp outlet, air max, louis vuitton outlet, oakley sunglasses, louis vuitton, michael kors, tory burch outlet, louboutin, louboutin pas cher, longchamp pas cher, prada outlet, air jordan pas cher, ugg boots, replica watches, oakley sunglasses, louboutin shoes, nike outlet, louis vuitton, christian louboutin outlet, polo ralph lauren outlet, cheap oakley sunglasses, ray ban sunglasses, nike free, uggs on sale, longchamp outlet, nike free, replica watches, oakley sunglasses, tiffany jewelry, longchamp, ray ban sunglasses, chanel handbags

ninest123 said...

kate spade handbags, ralph lauren uk, abercrombie and fitch, hollister pas cher, michael kors outlet, nike blazer, hogan, burberry outlet online, nike free run uk, coach purses, burberry, true religion jeans, oakley pas cher, north face, nike air max, ugg boots, north face, michael kors outlet, hermes, michael kors, michael kors outlet, nike roshe, nike air max, michael kors, michael kors, converse pas cher, new balance pas cher, tn pas cher, true religion jeans, lululemon, coach outlet, mulberry, nike air max, true religion jeans, ray ban uk, sac guess, lacoste pas cher, air force, michael kors outlet, michael kors, coach outlet, ray ban pas cher, true religion outlet, ugg boots, vanessa bruno, vans pas cher, replica handbags, timberland, michael kors outlet, hollister

ninest123 said...

insanity workout, ferragamo shoes, babyliss, mcm handbags, chi flat iron, p90x workout, converse, hollister, nike huarache, baseball bats, nike trainers, ray ban, soccer jerseys, nfl jerseys, vans, instyler, asics running shoes, louboutin, north face outlet, mac cosmetics, beats by dre, timberland boots, converse outlet, herve leger, nike air max, wedding dresses, new balance, nike roshe, jimmy choo shoes, iphone cases, vans shoes, ghd, soccer shoes, celine handbags, longchamp, north face outlet, mont blanc, reebok shoes, lancel, hollister, abercrombie and fitch, hollister, lululemon, ralph lauren, nike air max, gucci, valentino shoes, birkin bag, oakley, bottega veneta

ninest123 said...

moncler, canada goose, ugg,ugg australia,ugg italia, louis vuitton, louis vuitton, louis vuitton, louis vuitton, toms shoes, links of london, juicy couture outlet, pandora charms, wedding dresses, pandora charms, canada goose, swarovski crystal, montre pas cher, supra shoes, moncler, bottes ugg, ugg,uggs,uggs canada, sac louis vuitton pas cher, doudoune canada goose, moncler, ugg pas cher, hollister, canada goose outlet, canada goose, canada goose uk, replica watches, moncler outlet, moncler, canada goose, moncler, thomas sabo, ugg boots uk, swarovski, marc jacobs, karen millen, moncler, juicy couture outlet, pandora jewelry, moncler, pandora jewelry, coach outlet, canada goose outlet