Exclude Asset Library from search results by modifying search scopes

It’s possible to exclude SharePoint Lists from search results by excluding their types in the search scope definition.

Therefore you need to define an search scope rule based on a “property”. You have to use “contentclass” and a value.

There are much lists of the possible values out in the web.

Here is mine 🙂

Value Description
STS_Web Site
STS_List Custom List
STS_ListItem Custom List item
STS_List_DocumentLibrary Document Library
STS_ListItem_DocumentLibrary Document Libary item
STS_List_Links Link List
STS_ListItem_Links Link List item
STS_List_Events Event List
STS_ListItem_Events Event List item
STS_List_Tasks Task List
STS_ListItem_Tasks Task List item
STS_List_Contacts Contact List
STS_ListItem_Contacts Contact List item
STS_List_Announcements Announcements List
STS_ListItem_Announcements Announcements List item
STS_List_DiscussionBoard Discussion Board
STS_ListItem_DiscussionBoard Discussion Board item
STS_List_GanttTasks Gantt Task List
STS_ListItem_GanttTasks Gantt Task item
STS_List_IssueTracking Issue Tracking list
STS_ListItem_IssueTracking Issue Tracking item
STS_List_Survey Survey
STS_ListItem_Survey Survey item
STS_List_PictureLibrary Picture Library
STS_ListItem_PictureLibrary Picture Library Item
STS_List_WebPageLibrary Web Page Library
STS_ListItem_WebPageLibrary Web Page Library Item
STS_List_XMLForm (InfoPath) Form Library
STS_ListItem_XMLForm (InfoPath) Form Library item
STS_List_850 Page Library
STS_ListItem_850 Page Library item
urn:content-class:SPSSearchQuery Search Query
urn:content-class:SPSListing:News News Listing
urn:content-class:SPSPeople People
urn:content-classes:SPSCategory Category
urn:content-classes:SPSListing Listing
urn:content-classes:SPSPersonListing Person Listing
urn:content-classes:SPSTextListing Text Listing
urn:content-classes:SPSSiteListing Site Listing
urn:content-classes:SPSSiteRegistry Site Registry Listing

 

You can generally exclude list items from search by using the value “STS_ListItem_PictureLibrary” for the property “contentclass”.

But how to exclude items or lists of type “Asset Library” which is also a standard list template like “Document Library”, “Picture Library”, “Calendar List”, … and “Page Library” which has as code (850) as name. (Marked red in the list above.)

I checked the 14 hive and figured out the 850 is the list template ID of “Page Library”. And the list template ID of “Asset Library” is 851.

So I used the following query in the search box: “(scope:"All Websites") (contentclass:STS_List_851)

I created a new search scope exclude rule on the site collection using “STS_List_851” in it worked! Now there are no more Asset Libary links in the search result. If you you “STS_ListItem_851” you can exclude Asset Library Litems.

(No screenshots today, sorry!)

One thought on “Exclude Asset Library from search results by modifying search scopes”

  1. Hi Karstein,
    Even after using “STS_ListItem_851” with Exclude condition i am getting “…/SiteAsets/TestPage.aspx” document.

    Please can u help me out for this.

    Thanks for your helpful post.:)

    Regards
    Vijay

Leave a Reply

Your email address will not be published. Required fields are marked *