Friday, June 26, 2015

Exclude checkin comments

I had a request to hide checkin comments from searchresults in Sharepoint 2013. I decided to hide the column from the index.

This can be done from UI
  1. Central Administration>Search Service>Search Schema > Crawled Properties> Ows__checkinComment
  2. Uncheck Include in full-text index
  3. Full crawl

Or with powershell

Add-PSSnapin microsoft.sharepoint.powershell
$name = "ows__CheckinComment"

$searchapp = get-spenterprisesearchserviceapplication

$crawledprop = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Name $name
$crawledprop.IsMappedToContents = $false
And full crawl

Add-PSSnapin microsoft.sharepoint.powershell

$contents = get-spenterprisesearchcrawlcontentsource -SearchApplication "Search Service Application"

foreach ($content in $contents)
if ($content.crawlstatus -eq "Idle")
write-host "Idle, running crawl on $($"
else {write-host "$($ is not idle or on nogo-list" }


One thing to keep in mind is if CheckInComments column is visible on any Views on the site, that view will be returned in results.


No comments: