Adding full-text catalog
In this recipe, we will create a full-text catalog.
Getting ready
In this recipe, a full-text search component needs to be installed on your SQL Server instance.
Run the script B04525 - Ch06 - 10 - Adding Full-Text Catalog - Prep.ps1 to ready the database we will use in this recipe. This script creates a database called FullTextCatalogDB
that contains a table called Documents
.
How to do it...
Let's take a look at the steps to create a full-text catalog:
- 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:
$databaseName = "FullTextCatalogDB" $db = $server.Databases[$databaseName] $catalogName = "FTC" $ftc = New-Object -TypeName Microsoft.SqlServer...