Skip to content

‘IsDocument’ Managed Property Issues

May 8, 2012

For a client the other day, I was having an adventure in creating search scopes. The solution required us to only display search results for documents. Having some experience in creating custom scopes I attempted to use the “IsDocument” Managed Property. My logic was, “Hey, I’m looking for documents so I should use this property in my scope and only return results where this is true.”

I set the property for use in scopes and performed a full crawl. I created my custom scope to return results where “IsDocument=1”. I had 5 test documents (all different) on the site and each document had different types of metadata on them. When I finally used my custom search scope, only 2 of the five documents came back. I was confused because all the custom content types inherited from document content type and the value I searched for was in each of the document metadata.

At this point, I was confused until I dove deeper into the problem. To solve this issue, I created 5 documents from different content types using the same file and slightly varied metadata. The documents had the following Information:

Content Type Title TestField
Content Type One Tidal One Dark One
Content Type Two Tidal Two Dark Two
Content Type Three Tidal Three Dark Three
Content Type Four Tidal Four Dark Four
Content Type Five Tidal Five Dark Five

So I typed in “dark” into the search results and got five results back:

Awesome! Now then I tried “dark IsDocument=1” and got this:

Then I used IsDocument=1 with a word that I knew was in the document and returned five results again. Then it dawned on me what was happening.

IsDocument only matches on content INSIDE of documents, not the metadata. I went through a few more tests to verify this and confirmed it. At that point I changed the scope to only include the custom content types that we created for the solution and everything worked well.

Has anyone else had issues with Managed Properties not acting the way you think they should?

Leave a Comment

Leave a comment