Recently the crawl database in sharepoint search got corrupted. After we fixed the indexes, it kept getting corrupted so we just recreated the database and the issues went away. Here are the steps and power shell.
#You will need to change the search service application name, also your sql server name, and the guid of you crawl store.
Add-PSSnapin Microsoft.SharePoint.PowerShell
#List all crawl database:
Get-SPEnterpriseSearchCrawlDatabase -SearchApplication "Search service Application"
#Create a new Crawl database:
New-SPEnterpriseSearchCrawlDatabase -DatabaseName "Search_Service_Application_CrawlStoreDB" -DatabaseServer "SQLServerName" -SearchApplication "Search Service Application"
#Delete the crawl store that is corrupted or old.
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search service Application"
$cs = $ssa.CrawlStores
#list the crawl stores to find the corrupted or old one
$cs
#delete the old/corrupted store
$cs1 = $cs.Item("GUID of Old database")
$cs1.Delete()
# if the search is in a System paused for refactoring, use the command below to normal
#$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search service Application"
#$ssa.ForceResume($ssa.IsPaused())
#You will need to change the search service application name, also your sql server name, and the guid of you crawl store.
Add-PSSnapin Microsoft.SharePoint.PowerShell
#List all crawl database:
Get-SPEnterpriseSearchCrawlDatabase -SearchApplication "Search service Application"
#Create a new Crawl database:
New-SPEnterpriseSearchCrawlDatabase -DatabaseName "Search_Service_Application_CrawlStoreDB" -DatabaseServer "SQLServerName" -SearchApplication "Search Service Application"
#Delete the crawl store that is corrupted or old.
$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search service Application"
$cs = $ssa.CrawlStores
#list the crawl stores to find the corrupted or old one
$cs
#delete the old/corrupted store
$cs1 = $cs.Item("GUID of Old database")
$cs1.Delete()
# if the search is in a System paused for refactoring, use the command below to normal
#$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search service Application"
#$ssa.ForceResume($ssa.IsPaused())
COOL! Thank You!
ReplyDeleteWARNING - this does not work! I followed the instructions listed here on our on-premise Sharepoint 2013 farm and now I've a broken search environment. This is because the content sources will still refer to the old crawl store database and so will no longer run: crawls will be stuck on "starting" and you will receive the following errors in the ULS logs:
ReplyDeleteCGatherer::GetPartition returns invalid Database ID, DBID GUID-of-deleted-DB [gatherlink.cxx:821] search\native\gather\server\gatherlink.cxx
CGatherer::ProcessStartCrawlStatus: fail to commit links. Error 0x8000ffff [gatherobj.cxx:6581] search\native\gather\server\gatherobj.cxx
CGatherer::PingCrawl 129318, component aed56466-bce4-41e1-bfea-838f732bf66f-crawl-0 - ProcessStartCrawlStatus failed with error 0x8000ffff [gatherobj.cxx:2629] search\native\gather\server\gatherobj.cxx
It looks as if I will have to reprovision my search environment alas.
WARNING - this does work great!
ReplyDelete