Friday, March 20, 2009

Full Text Search in Sql Server

recently i came to work on sql server 2005 & 08 and full text search. i want to share some interesting point which i came to know in couple of hours. there are steps you need to follow for the quicj start.

1) check whether full text services is running on your system if it is running else goto step (4)
2) create new catalog for storing indexing if there is not any already created by issuing following command at query analyzer

create fulltext catalog MyCatalogNameHere as default

3) after creating catalog then it is time now to create index on required table used for full text searching by using command at query analyzer

Create fulltext index on MyTableName
(col1,col2,col3)
key index tableUniqueIndex
on MyCatalogName
with change_tracking auto

for MyTableName you need to place your own table name, col1, col2 and so on will be replaced with your table columns names, similarly, tableUniqueIndex will be replaced with the unique table scoped index that will be used for traversing to next records may be your primary key or any unique key.
**Note: if you removing "on MyCatalogName" then default catalog will be used for newly created indexing

" with change_tracking auto" option makes sure that whenever those indexed columens will be changes index will be modified automatically. others options may off or manual. you select off when table data chages rarely, and manually when you need to update indexing system manually.

4) install the full text search services from your sql server setup. after successful installation make sure that full text service is running properly. you can check that by right clicking My Computer >> Manage >> Services and Applications >> Sql Server Configuration Manager >> Sql Server 2005 Services >> Sql Server Full Text Search

**Note: i downloaded Microsoft SQL Server 2005 exepress edition with advanced services and Management Studio from microsoft site.