SharePoint 2007 Search Scopes

I recently needed to create a Search Scope in MOSS that returned only sites that matched the search term.  In this case, there was one site per customer account, and we wanted to be able to find each customer’s site quickly using search.

After some poking about, I found this article on MSDN that explained what to use for contentclass in a Search Scope programmatically to limit the results appropriately: STS_WEB.

So to implement this, create a new Search Scope and add a rule.  Choose a Property Query, where contentclass=STS_Web.

The other options for contentclass are listed below.  Note that there is some inconsistency in the way the various contentclasses are described.

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
Site:  STS_Web
List: STS_List
List Item:  STS_ListItem
Events:  STS_List_Events
Tasks:  STS_List_Tasks
Announcements:  STS_List_Announcements
Discussions:  STS_List_DiscussionBoard
Contacts:  STS_List_Contacts
Links:  STS_List_Links
Document Library: STS_List_DocumentLibrary
Document Library Items:  STS_ListItem_DocumentLibrary
Picture Library: STS_List_PictureLibrary
Picture Library Items: STS_ListItem_PictureLibrary

Technorati tags: , , ,

Similar Posts

2 Comments

  1. hey…
     
    I was just curious how far you’ve managed to get with this?  I’ve been trying to configur a search scope to manage our marketing department’s expectations and haven’t been having much luck.
     
    Basically, we want a search that is restricted to the intranet content site and its children.  We want pages, documents and list items from custom lists, but not the lists/libraries themselves.  I don’t suppose you have any thoughts on this, short of using a bunch of content type rules or something like that?
     
    Thanks!
  2. I need to do the opposite. I need to create a search scope for a specific document library.

    Thanks,
    Ninel

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.