Requirement:
We keep few fields for configuration in a custom SharePoint application and don't want those fields to appear in SharePoint Search results.
Solution:
SharePoint Fields/Columns has a property: NoCrawl, just turn it ON, we can exclude columns from SharePoint Search! Here is how I turned Off search visibility of a field using PowerShell:
We keep few fields for configuration in a custom SharePoint application and don't want those fields to appear in SharePoint Search results.
Solution:
SharePoint Fields/Columns has a property: NoCrawl, just turn it ON, we can exclude columns from SharePoint Search! Here is how I turned Off search visibility of a field using PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinueIt takes effect after a search crawl takes place.
#Set these two variables accordingly
$WebURL = "http://sharepoint.crescent.com"
$FieldName = "ConfigData"
#Get the Web
$web = Get-SPWeb $WebURL
#Get the field
$Field = $web.Fields[$FieldName]
#Set the search prefererence
$Field.NoCrawl = $true
$Field.Update($true)