I try to export the crawl log with PowerShell to analyze the errors and most importantly the warnings:
Add-PSSnapin microsoft.sharepoint.powershell -ea 0
$ssa = Get-SPEnterpriseSearchServiceApplication | Where-Object {$_.Name -eq "Search Service Application"}
$id = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa | ? { $_.Name -eq "Filer"}
$log = New-Object Microsoft.Office.Server.Search.Administration.CrawlLog $ssa
#GetCrawledUrls(bool getCountOnly, long maxRows, string urlQueryString, bool isLike, int contentSourceID, int errorLevel, int errorID, DateTime startDateTime, DateTime endDateTime)
Write-Host "Success:"
$dt = $log.GetCrawledUrls($false, 1000000, $null, $false, $id.Id, 0, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue)
$dt.Rows.Count | Out-String
Write-Host "Warnings:"
$dt = $log.GetCrawledUrls($false, 1000000, $null, $false, $id.Id, 1, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue)
$dt.Rows.Count | Out-String
Write-Host "Errors:"
$dt = $log.GetCrawledUrls($false, 1000000, $null, $false, $id.Id, 2, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue)
$dt.Rows.Count | Out-String
Write-Host "Deleted:"
$dt = $log.GetCrawledUrls($false, 1000000, $null, $false, $id.Id, 3, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue)
$dt.Rows.Count | Out-String
Write-Host "Everything:"
$dt = $log.GetCrawledUrls($false, 1000000, $null, $false, $id.Id, -1, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue)
$dt.Rows.Count | Out-String
$group = $dt | Group-Object "ErrorID"
$errors = $log.GetErrorMessages() # <= this guy returns an internal Type: Microsoft.Office.Server.Search.Administration.ErrorInfo
I tried to get the Warning/Error Messages with $log.GetErrorMessages() - but that does not return anything. I assume this is because the return type is Dictionary and ErrorInfo is an internal class.
Anyone can give me a pointer how to get the error messages?