How to Clean up Crawl History in SharePoint 2010

Posted: January 1, 2012 in SharePoint Search
Tags: , ,

Your crawl history can be a pain in the ass when the logs pile up..

SharePoint stores the crawl details in the following tables…

  • “Msscrawlhostlist” table contain hostname with hostid.
  • “MssCrawlHostsLog” table stores the hosts of all the URLs processed in the crawl.
  • “MssCrawlUrlLog” table keeps track of the history of errors encountered in the crawls.

When you have not set the retention period it keeps around 90 days of crawl logs…

You could clean up the crawl logs for a shorter period using powershell…

Get the Search Service Application ID:

  • Get-SPServiceApplication

Get the Search Service Application object:

  • $searchSvcApp = Get-SPServiceApplication | Where {$_.Id -eq “Search Service Application ID”}

Set the CrawlLogCleanUpIntervalInDays property:

  • Set CrawlLogCleanUpIntervalInDays.
  • $searchApp.CrawlLogCleanUpIntervalInDays = Retention Period
  • $searchApp.Update()

Hope it helps

Happy Hunting 🙂

Leave a comment