If you find yourself needing to limit the scope of a search to only the items in a list (i.e. you don’t want to return any of the view forms and other aspx pages in the search results) you can use the contentclass as part of the search scope definition. This is a great way to limit the search results to only the content in a list or library. Use the STS_ListItem_DocumentLibrary string to implement this rule.
There’s a good article on Jose Barreto’s blog that has a list of the contentclass filter strings. Niels Loup also has good info on this topic.
Basically you are creating a scope rule using a property query and specifying the property restriction of "contentclass" and making it "required." This scope rule can be combined with others to define what the scope returns.
Keywords:
contentclass
Property Query
Scope Rule
SharePoint MOSS 2007 Search
STS_ListItem_DocumentLibrary
1 Response to “Limiting the Search Scope using contentclass in a Property Query Scope Rule”