FAST for SharePoint 2010 enhances the regular SharePoint search by adding some cool stuff like document previews in the search results and item counts displayed in the refiners. Unlike the built in SharePoint search though, it is a little funky to configure and get up and running. Well, so it seemed based on the beta documentation I was working from.
Fortunately, I’ve scripted the configuration and simplified it! That wasn’t my original driver though. To be honest, it was the crummy database names it generated when I set it up through Central Admin. SharePoint taking the liberty with some database naming conventions is one of my biggest pet peeves with the product. It should always seek or at least provide the ability for user input to override its poor defaults, no matter which method they are using to configure it. The few cases it does not are a fail in my books.
Setup and Initial Configurations
My initial setup is on a farm using a SharePoint Server, FAST Admin Server, and SQL Server. On the SharePoint server, I installed the SharePoint 2010 prerequisites, SharePoint Server enterprise, Office Web Components, SharePoint Foundation and Server language packs, and then ran PSCONFIG.
On the FAST Admin Server, I installed the FAST prerequisites and FAST for SharePoint 2010. I then prepared the following XML deployment file and put it in the C:\FASTSearch\installer\scripts folder:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<deployment version=”14″ modifiedBy=”domain\farm-account” modifiedTime=”2010-05-25T13:10:00+01:00″ comment=”No Comment” xmlns=”http://www.microsoft.com/enterprisesearch” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://www.microsoft.com/enterprisesearch/deployment.xsd”>
<instanceid>FASTSearchTestFarm</instanceid>
<connector-databaseconnectionstring>
<![CDATA[jdbc:sqlserver://sql-server:1433; DatabaseName=SPTEST_FASTAdmin]]>
</connector-databaseconnectionstring>
<host name=”fast-server.domain.com”>
<admin />
<document-processor processes=”4″/>
<content-distributor id=”0″ />
<indexing-dispatcher />
<crawler role=”single” />
<webanalyzer server=”true” max-targets=”1″ link-processing=”true” lookup-db=”true” redundant-lookup=”false” />
<searchengine row=”0″ column=”0″ />
<query />
</host>
<searchcluster>
<row id=”0″ index=”primary” search=”true” />
</searchcluster>
</deployment>
With the deployment configuration file ready, I opened a FAST PowerShell command and ran as administrator, executing the following PSConfig found in the C:\FASTSearch\installer\scripts directory to configure the FAST admin server:
.\psconfig.ps1 -action i -roleName admin -userName domain\farm-account -localMachineName fast-server.domain.com -databaseConnectionString sql-server -databaseName SPTEST_FASTAdmin -deploymentFile C:\FASTSearch\installer\scripts\deployment.xml
The PowerShell prompts for a self-signed certificate password, and in this case I entered “Pa$$w0rd” for simplicity of the blog post. Take note of the C:\FASTSearch\Install_Info.txt for the farms service references.
A couple of files are needed to be copied from the FAST server to the SharePoint server. Copy the connector PowerShell script from C: \FASTSearch\installer\scripts\securefastsearchconnector.ps1 and the FAST certificate from C:\FASTSearch\data\data_security\cert\FASTSearchCert.pfx. I copied both files to the C:\FASTSearch directory I created on my SharePoint server. Finally, for good measure, restart the FAST server to complete the initial configuration.
SharePoint Service Application Configuration
On the SharePoint server, open the PowerShell Integrated Scripting Environment (Windows PowerShell ISE), running as administrator, and load the SharePoint cmdlets. Tip: a quick way to load all the SharePoint cmdlets in the ISE is to open and run this PowerShell script: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\SharePoint.ps1
My script is a little crude and rough still, and I’m sure you can improve it some for your environment. But hopefully it proves to be a good start for you! In the ISE, paste, edit, and run the following script that will create the query and connector service applications.
$FASTDirectory = “C:\FASTSearch”
$ServiceAppPoolAccount = “domain\farm-account”
$AdminServiceAppPoolAccount = $ServiceAppPoolAccount
#FAST Configuration Details
$ContentDistributorUri = “fast-server.domain.com:13391″
$AdminServiceUri = “http://fast-server.domain.com:13257″
$QueryServiceUri = “http://fast-server.domain.com:13287″
$ResourceStoreUri = “http://fast-server.domain.com:13255″
$AdminServiceAuthUser = $ServiceAppPoolAccount
#Databases
$DatabaseServer = “sql-server”
$DatabasePrefix = “SPTEST_”
$UsageApplicationDatabaseName = $DatabasePrefix + “UsageApplication”
$StateServiceApplicationDatabaseName = $DatabasePrefix + “StateServices”
$ConnectorServiceDatabaseName = $DatabasePrefix + “FASTConnectorService”
$QueryServiceDatabaseName = $DatabasePrefix + “FASTQueryService”
$ConnectorServiceApplicationName = “FAST Connector Service”
$QueryServiceApplicationName = “FAST Query Service”
$StateServiceApplicationName = “State Service”
$UsageApplicatoinName = “SharePoint Usage Application”
$ConnectorCollection = “sp”
#Create Usage Application
Write-Host “Creating usage application”
New-SPUsageApplication -Name $UsageApplicatoinName -DatabaseServer $DatabaseServer -DatabaseName $UsageApplicationDatabaseName
#Create State Service Application
Write-Host “Creating state service application”
$StateServiceDB = New-SPStateServiceDatabase -Name $StateServiceApplicationDatabaseName
$StateServiceApp = New-SPStateServiceApplication -Name $StateServiceApplicationName -Database $StateServiceDB
New-SPStateServiceApplicationProxy -Name $StateServiceApplicationName -ServiceApplication $StateServiceApp -DefaultProxyGroup
#Create App Pools
Write-Host “Creating app pools”
$ServiceAppPool = New-SPServiceApplicationPool -Name “ServiceAppPool” -Account $ServiceAppPoolAccount
$AdminServiceAppPool = New-SPServiceApplicationPool -Name “AdminServiceAppPool” -Account $AdminServiceAppPoolAccount
#Create Query Search Application
Write-Host “Creating query search service application”
$SearchQueryServiceApp = New-SPEnterpriseSearchServiceApplication -Name $QueryServiceApplicationName -ApplicationPool $ServiceAppPool -AdminApplicationPool $AdminServiceAppPool -DatabaseName $QueryServiceDatabaseName -DatabaseServer $DatabaseServer
New-SPEnterpriseSearchServiceApplicationProxy -Name “$QueryServiceApplicationName Proxy” -Uri $SearchQueryServiceApp.Uri.AbsoluteUri
#Create Connector Search Application
Write-Host “Creating connector search service application”
$SearchConnectorServiceApp = New-SPEnterpriseSearchServiceApplication -Name $ConnectorServiceApplicationName -ApplicationPool $ServiceAppPool -AdminApplicationPool $AdminServiceAppPool -DatabaseName $ConnectorServiceDatabaseName -DatabaseServer $DatabaseServer -SearchApplicationtype “ExtendedConnector”
New-SPEnterpriseSearchServiceApplicationProxy -Name “$ConnectorServiceApplicationName Proxy” -Uri $SearchConnectorServiceApp.Uri.AbsoluteUri
Write-Host “Starting search service instance”
$SearchServiceInstance = Get-SPEnterpriseSearchServiceInstance –local
Start-SPEnterpriseSearchServiceInstance -Identity $SearchServiceInstance
Set-SPEnterpriseSearchAdministrationComponent -SearchApplication $SearchConnectorServiceApp -SearchServiceInstance $SearchServiceInstance
Set-SPEnterpriseSearchServiceApplication -Identity $ConnectorServiceApplicationName -DefaultSearchProvider “FASTSearch”
$SearchConnectorServiceApp | Get-SPEnterpriseSearchAdministrationComponent | Set-SPEnterpriseSearchAdministrationComponent -SearchServiceInstance $SearchServiceInstance
New-SPEnterpriseSearchExtendedConnectorProperty -Name “ContentDistributor” -SearchApplication $SearchConnectorServiceApp -value $ContentDistributorUri
New-SPEnterpriseSearchExtendedConnectorProperty -Name “Collection” -SearchApplication $SearchConnectorServiceApp -value $ConnectorCollection
Write-Host “Setting connector search crawl topology”
$CrawlDatabase0 = ([array]($SearchConnectorServiceApp | Get-SPEnterpriseSearchCrawlDatabase))[0]
$InitialCrawlTopology = $SearchConnectorServiceApp | Get-SPEnterpriseSearchCrawlTopology
$CrawlTopology = $SearchConnectorServiceApp | New-SPEnterpriseSearchCrawlTopology
$CrawlTopology | New-SPEnterpriseSearchCrawlComponent -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $SearchServiceInstance -IndexLocation $SearchServiceInstance.DefaultIndexLocation
Write-Host “Setting the new crawl topology to active”
$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology –Active
Write-Host “Waiting for the new crawl topology to initialize”
While($InitialCrawlTopology.State -ne “Inactive”){}
$InitialCrawlTopology.Delete()
#Configure Query Search Application
$SearchQueryServiceApp | Get-SPEnterpriseSearchAdministrationComponent | Set-SPEnterpriseSearchAdministrationComponent -SearchServiceInstance $SearchServiceInstance
Set-SPEnterpriseSearchServiceApplication -identity $QueryServiceApplicationName -defaultsearchprovider “FASTSearch”
Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $QueryServiceApplicationName -Identity “FASTSearchAdminServiceLocation” -Value $AdminServiceUri
Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $QueryServiceApplicationName -Identity “FASTSearchQueryServiceLocation” -Value $QueryServiceUri
Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $QueryServiceApplicationName -Identity “FASTSearchResourceStoreLocation” -Value $ResourceStoreUri
Set-SPEnterpriseSearchExtendedQueryProperty -SearchApplication $QueryServiceApplicationName -Identity “FASTSearchAdminServiceAuthenticationUser” -Value $AdminServiceAuthUser
Write-Host “Setting query search crawl topology”
$InitialCrawlTopology = $SearchQueryServiceApp | Get-SPEnterpriseSearchCrawlTopology –Active
$CrawlDatabase0 = ([array]($SearchQueryServiceApp | Get-SPEnterpriseSearchCrawlDatabase))[0]
$CrawlTopology = $SearchQueryServiceApp | New-SPEnterpriseSearchCrawlTopology
$CrawlComponent = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $SearchServiceInstance -IndexLocation $SearchServiceInstance.DefaultIndexLocation
Write-Host “Setting the new crawl topology to active”
$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology –Active
Write-Host “Waiting for the new crawl topology to initialize”
While($InitialCrawlTopology.State -ne “Inactive”){}
$InitialCrawlTopology.Delete()
Write-Host “Setting the query topology”
$QueryTopology = New-SPEnterpriseSearchQueryTopology -SearchApplication $SearchQueryServiceApp -Partitions 1
$IndexPartition = Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology
$QueryComponent = New-SPEnterpriseSearchQueryComponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition -SearchServiceInstance $SearchServiceInstance -IndexLocation $SearchServiceInstance.DefaultIndexLocation
$PropertyDatabase0 = ([array]($SearchQueryServiceApp | Get-SPEnterpriseSearchPropertyDatabase))[0]
$IndexPartition | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase0
$QueryTopology.Activate()
#Start the Search Query and Site Settings Service
Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance -Local | Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance
#Export SharePoint Cert & Import FAST Cert
Write-Host “Exporting the SharePoint Certificate”
$SharePointCertFileName = Join-Path -Path $FASTDirectory -ChildPath “SharePointCert.cer”
$SharePointCert = (Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate
$SharePointCert.Export(“cert”) | Set-Content -encoding byte $SharePointCertFileName
cd\
cd $FASTDirectory
. .\securefastsearchconnector.ps1 –certPath “.\FASTSearchCert.pfx” –ssaName $ConnectorServiceApplicationName –username $AdminServiceAuthUser
After this script finishes executing, copy the SharePoint certificate from c:\FASTSearch\SharePointCert.cer on the SharePoint server to the FAST server in c:\FASTSearch\installer\scripts\SharePointCert.cer
Enable Click-Through Relevancy and Import SharePoint Certificate on FAST
On the FAST server, open the PowerShell ISE running as administrator and paste, edit, and execute the following PowerShell:
$SharePointIdentity = “domain\farm-account”
$ScriptsDirectory = “C:\FASTSearch\installer\scripts”
$SharePointCertPath = $ScriptsDirectory | Join-Path -ChildPath “SharePointCert.cer”
cd\
cd $ScriptsDirectory
.\ConfigureSharePointAuthorization.ps1 -InstalledMode Advanced -SharePointUserIdentity $SharePointIdentity
$trustedPeopleCertStore = New-Object System.Security.Cryptography.X509Certificates.X509Store(“TrustedPeople”, [System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine)
$trustedPeopleCertStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
$SharePointCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$SharePointCert.Import($SharePointCertPath)
$trustedPeopleCertStore.Add($SharePointCert)
$trustedPeopleCertStore.Close()
In Central Admin, double check that the query service application is associated with the default service application group or the web application the FAST search center is hosted in. You need to create service applications for the Office Web Components if you want the view previews of your Office documents in the search results.
You can add content sources for SharePoint and other content in the connector service application and crawl some content to begin testing search. Don’t forget to add the people profile content source (i.e. sps3://mysite) to the query service application instead of the connector service application for people searches. From there, you’re all set!