On a recent SharePoint 2010 project I’ve been asked to configure the search experience. There’s been no great customisation to do in this instance, however with just a little configuration it’s been possible to achieve great results (pun intended).
I’ve started from a site based on the Enterprise Search Centre template and made a few modifications such as adding a scope with a custom search results page, returning federated search results, and ensuring that the content sources are setup correctly etc.
In addition, I’ve also made use of the great new Refinement Panels that are available out of the box with the Microsoft SharePoint 2010 search experience. For great information on what these refinement panels are and how they can be configured I’d suggest heading over to the SharePoint Analyst HQ blog by Michal Pisarek.

In my case we have some areas of the solution that have a well-defined set of Content Types. Out of the box there is a refinement panel for ‘Result Type’ however this is different to the content type, e.g. Word as opposed to Proposal. So the challenge was to create a new refinement panel to replace the Result Type refinement panel. Note, it was to replace in my case but there’s no reason why it can’t be in addition to.
The steps to go about this are:
- From central administration navigate to the search service application and create a new managed property mapped to the ows_ContentType property. I named mine ContentTypeRefinement
- Note, for some reason the default Content Type manage property will not work as a refiner
[Update 31/01/2011: Michal has written another great post, which explains why this is so] - Remember to kick off a full crawl after creating your managed property
- Note, for some reason the default Content Type manage property will not work as a refiner
- Edit the search results page, and modify the Refinement Panel web part
- In the Refinement category modify the Filter Category Definition to include the following XML:
<Category Title="Content Type" Description="The content type of the item" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="0" SortBy="Frequency" SortDirection="Descending" SortByForMoreFilters="Name" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="ContentTypeRefinement" MoreLinkText="show more" LessLinkText="show fewer"/>
Saving the page you should now see a refinement panel for Content Types:
Fantastic! But wait, there’s more. If you are using content types throughout your site and have a well-structured taxonomy it’s possible that you’ll want to group the options in the refinement panel to reflect, say, similar content types. This can be done by editing the XML to associate values with a particular refinement as per the below example:
<Category Title="Content Type" Description="The content type of the item" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="0" SortBy="Frequency" SortDirection="Descending" SortByForMoreFilters="Name" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="ContentTypeRefinement" MoreLinkText="show more" LessLinkText="show fewer"> <CustomFilters MappingType="ValueMapping" DataType="String" ValueReference="Absolute" ShowAllInMore="False"> <CustomFilter CustomValue="Invoice"> <OriginalValue>Invoice</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Project Document"> <OriginalValue>Proposal</OriginalValue> <OriginalValue>Specification</OriginalValue> </CustomFilter> </CustomFilters> </Category>
From the screenshots in this post you can see that we’ve taken the out of the box refinement panel and customised it through several stages to provide a solution specific refinement panel.











Hey Glyn!
You must be psychic because I was just about a blog about the same thing! Awesome work mate and instead of posting the same thing over I might change my post a little to add some more details around why you can’t use the out of the box managed property and also an issue I ran into doing this if you use the default document content type for everything (which unfortunately many people do).
Cheers
Thanks Michal! I’ll look out for your post as I definitely want to know what the issue with the OOB managed property – very strange.
Cheers
[...] This post was mentioned on Twitter by Glyn Clough, Tony Stanley. Tony Stanley said: Excellent #sharepoint2010 #search Refinement Panels article http://bit.ly/hxxe4I [...]
Great post – making brilliant use of the out of the box capabilities.
Andrewwoody
[...] to write an article about refining on Content Types in SharePoint 2010 but Glyn Clough wrote such a awesome post that there would be no [...]
[...] To get a useful refiner based on the SharePoint Content Type, I used the method outlined by Glyn in his article: Create a content type search refinement panel in SharePoint 2010 [...]
Hi Glyn
Thanks for the info, I did get the OOTB ‘Content Type’ property working as a refiner, but not very well.
I did so using PowerShell and have detailed how over on my blog with links back here: http://gavinb.net/2011/03/21/fast-custom-refiner-on-content-type/
Ultimately I used your method.
-Gavin
I have run through this but each time I add the refinement xml and save the page it defaults to previous xml. Any ideas?
Hi James, it sounds like you need to unselect the ‘use default configuration’ checkbox. This seems to overrule any changes made if it’s selected. I definitely recommend Michal’s blog where he points out this and other useful info.
Thanks,
[...] I found Glyn’s blog really useful for understanding the concept and good set up [...]
Greetings Glyn,
Your blog is to the point and informative. I always appreciate when people share their experiences. I just have a couple questions that I hope you might be able to answer before I get too far in setting up our new farm (upgrading from 2007).
Will this also work with External Content Types? I assume ows_ContentType is still valid or do External Content Types map to a different property?
Thanks!
Hi Paul – thanks for the feedback. Unfortunately I’ve yet to fully explore external content types and so can’t answer your question immediately. I can’t see a reason why this shouldn’t work however!
Thanks,
I just tried it, but this wont work for external content types
Thanks for the great post. I tried created a new managed property as you suggested, I can’t seem to get SP to return anything in that property. The property name shows up in the the search results xml but it is empty. Have done a full crawl, still nothing. Any suggestions as to what I might be doing wrong?
Thanks Matt – not sure if you’ll have tried this or not, but you need to have an item with a value in it for the managed property to return a result. As it’s content type we’re talking about here then I assume that there are items in your site! But try adding a new document etc and then kicking off a full crawl again perhaps?
Thanks,
Hi Glyn,
Yes, correct, I have several Document libraries with several. .txt files in them. I have both custom content types (via my content type hub) as well as OOTB ones, such as Document and Image. I would have expected to see those in the results, but nothing. I did notice that a single one did come through:
Wiki Page
but that was the only one with a value. I had 9 items in the result set yet only one showed a value for contenttyperefinement.
Here is a snippet from the results xml. This one should have had a value but did not. I did a full crawl just before generating this:
2
2412
67699254
Paperclip Request Form.txt
, Matt
, Matt
22
http://mysitedev.dev.company.com/personal/matt_/Shared Documents/Paperclip Request Form.txt
http%3A%2F%2Fmysitedev%2Edev%2Ecompany%2Ecom%2Fpersonal%2Fmatt%5F%2FShared%20Documents%2FPaperclip%20Request%20Form%2Etxt
6/23/2011
http://mysitedev.dev.company.com/personal/matt_/Shared Documents
0
Two Weeks Only
Paperclip Request Form
Paperclip Request Form.txt
http://mysitedev.dev.company.com/personal/matt_/Shared Documents/Paperclip Request Form.txt
STS_ListItem_DocumentLibrary
True
0
0
TXT
RecordType|Record Type|Q1DQLw1xb0ibPLl1kOHMPw==|LkQCPsR6wkG7TZCcaOl+4g==|#6068db07-6523-4611-8171-f2083ca60aca|Two Weeks Only;#
/_layouts/images/ictxt.gif
Also my managed property is choosing the same properties as ContentType.
Basic:5(Text), ows_ContentType(Text)
[scratching head] ….perplexed.
Okay, I think I got it now. I was refreshing the wrong index so now I have search returning the property. Whats left is to configure the refinement panel. Again thanks for the great post, this was a big help to me.
Great stuff Matt! I almost suggested that as I’ve done exactly the same thing in the past! (Especially when Fast is installed). Glad you got it sorted.
I guess the xml formatting didn’t come through very well. :S
Hi Glyn, great blog. But I have a question. I am trying to implement a custom filter for the refiner “Site”. I need to show certain sites alphabetized in a certain way. I am running FAST for SharePoint. And no matter what, I cant seem to be able to get the custom filter working. I even tried creating a new managed property based off of the SiteName managed property. The refiner works with this new managed property but the custom filter does not. Upon further investigation, I came upon this -
FAST Custom Filters for String
With Fast, we can only use RangeMapping for custom filters not ValueMapping and String Data type only works with ValueMapping. So in short, we cannot us String-based custom filters with FAST. Only datetime and numeric
Is this true? I cant seem to be able to confirm this based on your or Gavin’s blogs. It seems like ValueMapping cannot be used for a FAST search environment and hence I dont have an option to refine my site names refiner?
-Madhu
Hi Madhu – I’m sorry, I don’t have a FAST setup to take a look at this for you; though it sounds like you’re trying all the right things. If you’re looking for more info then you could try Michal Pisarek’s blog or twitter account as he’s done some great things with search.
HTH
[...] http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.ht… Like this:LikeBe the first to like this post. This entry was posted in Allgemein. Bookmark the permalink. ← Search Scopes in SharePoint Server 2010 SharePoint Search Server: Add a property in the Advanced Search form → [...]
Will this work for FAST in Sharepoint? I added the in my code, but the result is not displaying.
0
1
hi Glyn,
i have followed all the steps but still i am not able to see my custom property in refinement panel, i am also able to see my custom filter tag in xml of refinement panel , add department property which is a site column and then started full crawl, i have selected add this property in all scopes but i am not getting the result..pls suggest something
Hi Guarav – it sounds like you’ve done the right steps – the only thing I can think of is to make sure that you’ve unselected the ‘use default configuration’ option. This catches me out every time!
[...] types de contenu. Pour cela, il faut utiliser la méthode de Glyn Clough que vous trouverez ici : http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.ht… afin de pouvoir ajouter une propriété gérée pointant sur le type de contenu de chaque [...]
Hi Glyn,
Great post, I’m trying to add Modified By to the refinement panel
but can’t seem to get it to work, can you help?
Thanks
Guy
Hi Guy – I haven’t tried this before, but I think it should be possible. I know that the ‘Author’ column is available as a refinement OOB, so it’s worth investigating that to see if you can replicate for Modified By. Note, you may have to add a new managed property to get this up and running.
Thanks,
Does this take a lot longer when I re-crawl everything? I was doing full crawls before and it would only take 7 minutes. Now it is running past 30 minutes and still going.
Hi Matthew – as far as I know this shouldn’t impact crawl time at all…
[...] http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.ht… Gefällt mir:Gefällt mirSei der Erste, dem dieser post gefällt. Kategorien:SharePoint, Suche [...]
[...] http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.ht… Share this:TwitterFacebookGefällt mir:Gefällt mirSei der Erste, dem dieser post gefällt. [...]
Hello Glyn
This is exactly what I am looking for to do, but I dont have access to my test or production environment, only development.
I wonder if there is an easy way to do this in a way that the test and production team can install it easily. powershell? or a WSP package?
Thanks
[...] I need to do this: http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.ht… [...]
[...] http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.ht… [...]
@Guy: here are some clues how to add Modified By as a managed property:
Modified by column value not coming in Sharepoint Search
After running the full crawl you’re able to add a custom category for ‘Modified By’ to the Refinement Panel.