Thursday, February 20, 2014

Exclude a Column from SharePoint Search Crawl

Requirement: 
By default, SharePoint search engine craws and indexes all documents and its associated metadata properties from lists and libraries. In our case, We keep few fields for configuration in a custom SharePoint application and don't want those fields to appear in SharePoint Search results.

This is applicable only to site columns in SharePoint!

How to Exclude a column from SharePoint Search?
Here is how you can remove columns from SharePoint search.
  • Navigate to the site settings page by clicking settings gear 
  • On the Site Settings page, click on "Searchable Columns" link under search group.
    exclude column from sharepoint search
  • Select the check box next to the column(s) that you want to suppress from search. 
  • Click OK to save your changes.

This ensures the particular metadata column isn't picked up by the search engine in SharePoint and excludes the site column data within the current site.

PowerShell Script to Exclude Field from Search:
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 SilentlyContinue

#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)
It takes effect after a search crawl takes place.



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...