How to: Querying Enterprise Search by Content Type
Posted
Friday, August 14, 2009 1:29 PM
by
CoreyRoth
A colleague asked me today how he could formulate a search query by content type today. I figured it was as simple as doing a keyword query by content source, but wasn’t sure so I decided to go check. I took a look and there is a ContentType managed property so I decided to use it as in the following example.
ContentType:”Company Document”
In my example, I wanted to return all documents that were of type Company Document. This in fact worked exactly as expected as you can see in my screenshot below.
This means you can of course display the content type in your search results if you want by modifying the selected columns XML document of the CoreResultsWebPart. For more information about customizing search results, see this post. This is just a quick post today, but hopefully it will help you if you ever need to query in this manner.