Online Training On SharePoint

Monday, 26 April 2010

Restricting the results based on a Content Type for FAST Search for SharePoint 2010

We can restrict to show the search results based on a specific content type in FAST Search for SharePoint 2010. I had a requirment where I need to filter the data and show results only from a specific library. This library was associated to a particular content type. The easiest way to acheive this to do a query and filter the data based on the content type. I will now explain how we can do this. First we need to create a property in FAST Search. To see the detailed description on how to create a managed property check here
The important thing here is we need to select the ows_contenttype crawled property as crawled property:

Also we need to make sure to check the Query Property while creating this managed property:

Now once this is done we need to do a full crawl so that we can do query on this managed property.

I have created my managed metadata with the name contenttypeproperty. Also lets asssume my content type name is democontenttype. Now we can do a search like
test contenttypeproperty:democontenttype
With this query the search will only return the items having the content type as democontenttype.

On the similar lines if we just need to return the documents in the search results we can change the query to:
test contenttypeproperty:document
With this query it will only be showing the documents in the search resutls core web part.
Post a Comment
Related Posts with Thumbnails