Installing FullText Search on SQL Server 2008
1. Download SQL Express with FullText Search capability for SQL Server 2008
http://www.microsoft.com/express/Database/InstallOptions.aspx
2. Select Installation Type as New Installation
3 During Feature Selection, select Full-Text Search
4. While Instance Configuration, Create new Instance Configuration.
- Select Named Instance and give new name. Example: I have given name: MyShriGanesh
5. Main steps for installation are done, now simply press next with default choices and complete the installation.
6. After Installation login with new instance name created.
- Example: Earlier I have created named instance MyShriGanesh, so i need to login with same named instance in order to take benefit of FullText Search feature.
7. Now, Create New Database, Run Tables and SPs Scripts and restore database with data. If you don't have one already, download sample database and use that database.
After installation of sample database your object explorer will look like as follow:
8. Open Query Window and type following command to test whether FullText Search is installed or not.
Select SERVERPROPERTY('IsFullTextInstalled')
If this query returns a value of '1' then the component is installed.
Now, lets go step by step to run Full Text Search on SQL Server 2008
Step 1: Creating Full Text Catalog in SQL Server 2008
Syntax:
Create FullText Catalog DatabaseNameCatalog
Example:
Create FullText Catalog AdventureWorksCatalog
- TableName is name of table you would like to create fulltext index.
- ColumnName is column on which you would like to create fulltext index, it is column you would like to perform search on.
- PK_TablesPrimaryKey is primary key of table you are creating on fulltext search index.
- DatabaseNameCatalog is fulltext search catalog created earlier.
Select [Description]
from Production.ProductDescription
Where
FREETEXT([Description], 'Entry Level Bike')
Example 3: Using Weight keyword
Select [Description]
from Production.ProductDescription
Where
Contains([Description],
'ISABOUT (Entry Weight(.8), Level Weight(.4), Bike Weight (.2))')
Select [Description]
from Production.ProductDescription
Where
Contains([Description],
'FormsOf (INFLECTIONAL, Entry, Level, Bike)')