Saturday, October 13, 2012

SQL SERVER - How to create Full Text Search in SQL Server

Just follow this simple steps for Full Text Search in SQL Server
1.      Open the Solution Explorer in SSMS and navigate to database
2.      Into the database navigate to Storage Folder
3.      Rigth click on the full text Catalog and provide the Catalog name and press OK button
4.      Now open to database table, and right click on the table and go into the   Full Text Index option and select the ‘Define Full Text Index’ option.
5.      Then Full Text search wizard will open and click on next and choose the Indexed column or Identity column (i.e. EmployeeID) from drop down list, and when will select query will fire this indexed column must be in a query (See Example – EmployeeID).
6.      Next, then select the Column name (i.e. Title) for full text searching and select the language. Then click Next
7.      select any one the change track that are automatic(for default), manual and Do not change track, then Click Next
8.      Select the Catalog name and next and Finish.
9.      Then run the below query on SSMS.

Examples :-
   -- This query will search every Column of the table

SELECT EmployeeID , [Title]   FROM [Employee]
         where freetext (*, 'Accountant or Manager')

   -- or it will search only Title Column

SELECT EmployeeID , [Title]   FROM [Employee]
where  contains (Title , 'Accountant AND Marketing')

Like and Share to SQL Integrity Blog

No comments:

Post a Comment

Thank You !!!!