Monday, January 7, 2013

Crawling root web of a site collection

I was recently trying to troubleshoot a search problem with my application. It turned out that there was a list at the root web of a site collection that was not being indexed by search.

$ssa = Get-SPEnterpriseSearchServiceApplication | Where-Object {$_.Name -eq "FAST Search Query Service Application"}
$logViewer = New-Object Microsoft.Office.Server.Search.Administration.LogViewer($ssa)
$urlProperty = [Microsoft.Office.Server.Search.Administration.CrawlLogFilterProperty]::Url
$stringOperator = [Microsoft.Office.Server.Search.Administration.StringFilterOperator]::Contains
$crawlLogFilters = New-Object Microsoft.Office.Server.Search.Administration.CrawlLogFilters
$searchUrl = 'my URL'
$crawlLogFilters.AddFilter($urlProperty, $stringOperator, $searchUrl)
$i=0
$urls = $logViewer.GetCurrentCrawlLogData($crawlLogFilters, ([ref] $i))
$urls

Then I checked with a colleague and it turns out that all I needed to check was Site Actions->Site Settings->Search and offline availability. The "Allow this site to appear in search results" was set to No. 

No comments:

Post a Comment