Monday, December 17, 2012

Search Scope Rules - Property Values for “contentclass” Property

In my previous post on PowerShell Script to Create Search Scopes, I used “contentclass” property to create rules by selecting Property Query for scope rule type.

$rule = New-SPEnterpriseSearchQueryScopeRule -RuleType PropertyQuery -ManagedProperty "contentclass" -PropertyValue "STS_List" -FilterBehavior "Exclude" -url $webAppUrl -scope $createdScope -SearchApplication $SSA

Here is a list of various values for contentclass that can be used as property values:

Site:                                 STS_Web
Site Collection:                   STS_Site
Pages Library:                    STS_List_850
Page:                                STS_ListItem_850
Document Library:               STS_List_DocumentLibrary
Document Library Items:      STS_ListItem_DocumentLibrary
Custom List:                      STS_List
Custom List Item:               STS_ListItem
Links List:                          STS_List_Links
Links List Item:                   STS_ListItem_Links
Tasks List:                         STS_List_Tasks
Tasks List Item:                  STS_ListItem_Tasks
Events List:                       STS_List_Events
Events List Item:                STS_ListItem_Events
Announcements List:           STS_List_Announcements
Announcements List Item:    STS_ListItem_Announcements
Contacts List:                     STS_List_Contacts
Contacts List Item:              STS_ListItem_Contacts
Discussion List:                   STS_List_DiscussionBoard
Discussion List Item:            STS_ListItem_DiscussionBoard
Issue Tracking List:             STS_List_IssueTracking
Issue Tracking List Item:      STS_ListItem_IssueTracking
Project Tasks List:              STS_List_GanttTasks
Project Tasks List Item:       STS_ListItem_GanttTasks
Survey List:                       STS_List_Survey
Survey List Item:                STS_ListItem_Survey
Picture Library:                   STS_List_PictureLibrary
Picture Library Item:            STS_ListItem_PictureLibrary
Web Page Library:               STS_List_WebPageLibrary
Web Page Library Item:        STS_ListItem_WebPageLibrary
Form Library:                      STS_List_XMLForm
Form Library Item:               STS_ListItem_XMLForm
Search Query:                    urn:content-class:SPSSearchQuery
News Listing:                     urn:content-class:SPSListing:News
People:                             urn:content-class:SPSPeople
Category:                          urn:content-classes:SPSCategory
Listing:                             urn:content-classes:SPSListing
Person Listing:                   urn:content-classes:SPSPersonListing
Text Listing:                      urn:content-classes:SPSTextListing
Site Listing:                       urn:content-classes:SPSSiteListing
Site Registry Listing:           urn:content-classes:SPSSiteRegistry

1 comment:

Prasad Sampath Wickramasinghe said...

Another way to hide list views and other background pages from the search results is to use crawl rules. Go to Central Administration -> Search Service Application -> Crawl Rules. Exclude following paths one by one.

*://*webfldr.aspx*
*://*mod-view.aspx*
*://*my-sub.aspx*
*://*allitems.aspx*
*://*allforms.aspx*
*://*/lists/*
*://*DispForm.aspx*