in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, Office 365 / SharePoint Online and Visual Studio 2013.

How to: Querying Enterprise Search by Content Type

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.

EnterpriseSearchContentType

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.

Comments

 

Document Type Query: Okay for Horseshoes, Not for Real Life : Beyond Search said:

Pingback from  Document Type Query: Okay for Horseshoes, Not for Real Life : Beyond Search

August 17, 2009 12:07 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2015 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems