Paul Galvin's (old) SharePoint space [SharePoint

Just another WordPress.com site

Quick Tip: Use “IsDocument:1” to Trim Search Results

Update 11/03/08: Fellow MVP Mike Walsh correctly points out that this is a WSS 3.0 / MOSS feature.  It does not work in WSS 2.0 or earlier.

Updatte 11/03/08: (Second update in one day!): Be sure to read the excellent comment from "nowise" for more info and another good xref link.

Two questions came up in rapid succession this week on the MSDN forums asking a variation of this:

"When I search a keyword, folders from my document library with that keyword in their path will come out first in my search results. I don’t want that to happen. Files with that keyword are more important to me.  I don’t want to see folders at all."

This is actually quite easy to do out of the box.  Simply add a "IsDocument:1" to the search query and SharePoint search (both WSS and MOSS) will restrict itself to showing actual documents.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Technorati Tags:
Advertisements

4 responses to “Quick Tip: Use “IsDocument:1” to Trim Search Results

  1. Unknown November 3, 2008 at 3:51 am

    You can also add contentclass to the search query. If you want to only search documents in document library\’s you add "IsDocument:1 ContentClass:STS_ListItem_DocumentLibrary" to the search query. This can be used to avoid getting hits on aspx pages and other non document library items. For a complete list of ContentClasses check Mark Anderson\’s Blog

  2. Sandeep January 7, 2009 at 2:14 pm

    Hi Paul. i was looking for this for a long time. I have a question. I am the admin for sharepoint site. Where do i add IsDocument:1 in sharepoint search? how do i get there? Also how do i change the query?iIenabled IsDocument to \’Allow this property to be used in scopes\’ from Shared Services Administration: SharedServices3 > Search Settings > Managed Properties and in Scopes, i added the rule IsDocument=1 for Property query.When i run the crawler, the \’Item count\’ for this rule in the scope says \’error\’. Where am i going wrong?

  3. Sandeep January 7, 2009 at 2:27 pm

    my actual requirement is that when a user searches with a keyword, the search results should contain content to which the user has access to. how do i enable this \’security trim search results in moss\’ ? or is it enabled by default?

  4. Paul March 18, 2009 at 6:46 am

    Sandeep, You probably figured this out weeks ago, here goes anyway…You don\’t need to do anything special to enable security trimming. WSS 3.0 and MOSS (any flavor) has security trimming built in and in fact, it cannot be turned off.As for the scope question, I don\’t know. What you did sounds right ot me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: