Adding full-text index
In this recipe, we will create a full-text index.
Getting ready
Before we proceed with this recipe, ensure that you have already created a full-text catalog in your instance. If you haven't created one, you can run the B04525 - Ch06 - 10 - Adding Full-Text Catalog - Prep.ps1 file that creates the sample database and full-text catalog and follow the Adding a full-text catalog recipe before proceeding with this recipe.
How to do it...
Let's take a look at the steps to create a full-text index:
- Open PowerShell ISE as an administrator.
- Import the
SQLPS
module and create a new SMO Server object as follows:#import SQL Server module Import-Module SQLPS –DisableNameChecking $instanceName = "localhost" $server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName
- Add the following script and run it:
#database $databaseName = "FullTextCatalogDB" $db = $server.Databases[$databaseName] #catalog $catalogName...