Vivos Tip: Utor “IsDocument:1” ut Trim Search Results

Update 11/03/08: Conservus MVP Mike Walsh recte ostendit hoc esse WSS 3.0 / MOSS feature. It does not work in WSS 2.0 vel maturiorem.

Updatte 11/03/08: (Secundo update in die una!): Be sure to read the excellent comment from "nowise" et in bono alio more info xref nectunt.

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.

</finem>

Scribet ad mea blog.

Sequi me in Twitter ad http://www.twitter.com/pagalvin

Technorati Tags:

4 cogitationes on "Vivos Tip: Utor “IsDocument:1” ut Trim Search Results

  1. Paulus Galvin

    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 et MUSCUS (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.

  2. Sandeep Abhyankar

    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?

  3. Sandeep Abhyankar

    HI Paulus. i was looking for this for a long time. Habeo quaestio. 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?

  4. Scripsit nowisee:

    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

Leave a Reply to Sandeep Abhyankar Cancel reply

Tua inscriptio electronica non editis. Velit sunt insignis *