Showing items counts in SharePoint 2010 Search Refiners
FAST Search has a great feature that shows you the count of search refiners when you perform a search showing the user exactly how many of the search results match the particular peice of metadata so that you can quickly narrow down the search to the results you are interested in.
However these refiner counts are available in SharePoint 2010 Search, but you do have to enable them.
To add refiner counts on your non FAST search results page you have to add a property in the metadata for the Refinement panel.
Simply edit the refinement panel, choose the Filter Definition Category under the Refinement options and for the refinement type that you want to show counts for (in our case Result Type) you have to add the ShowCounts attribute to each property you want to show counts for.
<Category Title="Result Type" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" ShowCounts="Count"/>
Now all you have to do is add the ShowCounts=”Count” attribute and you will see counts appear in your results!
If you can’t get this to work its most probably because you didn’t uncheck the ‘Use Default Configuration’ check box in the refinement panel. Do this an you should be good (god it took me an hour to find this damn thing so use my pain
Category: How To








Hi Michal,
very handy article (well, string of articles on refiners).
I’ve just been working up my own refiners based on some fields I’ve crawled.
They’re a mix of sharepoint (2010 and 2007) document library textual columns and one Managed Metadata column (hierachical taxonomy with about 300 terms, with no more than 4 levels deep).
And then the whole lot is crawled with FAST.
I’ve managed to get one of my three refiners to turn up on the search results page (the other two I suspect I need to tweak the settings in Managed Properties, as I suspect the data isn’t getting through at crawl/index time).
But I’m finding the refiners behaviour a bit odd.
Two things:
1. I can’t seem to get the counts going (yes, I’ve unticked “use default settings”.
2. When there are more than NumberOfFiltersToDisplay items (for my refiner), the “show more” link apears, but no further refiners do. Click the “show more” and the remaining (up to max) items appear, along with all the other refiner categories.
It’s really odd and quirky.
Here’s my XML:
Note: I’m still getting to grips with the terminology, so excuse my confusing explination.
Thanks
Craig
Hi Michal,
The counts using the SharePoint 2010 search do not appear to be accurate. For instance, a result set with over 4000 hits shows only 3 Word docs in the refiner. When I click the Word refiner it then shows 50. There are more than 50 Word docs in my results. Any Idea why>
Thanks,
David
Hey David,
Have you tried setting the Accuracy index to a larger number as per my post here -> http://www.sharepointanalysthq.com/2010/06/sharepoint-2010-search-refinement-panel-options/
I suspect that might be the issue, if not let me know.
Cheers
Hey Craig,
Interesting.. can you send me or paste your XML for the refiner part to me and I will have a look.
It does seem odd that no refiners are showing, what type of fields are the other two?
Cheers
In my web site I have more than 5000 records per search. But I can see a big difference between refiner count and the no of results. I changed the accuracy index to 500. I couldn’t give a value more than 500 to a accuracy index. But still I can see a big difference between these two. I want to show the exact refiner count.
Any solution for this.
Thank you.
Regards,
Achini.
I have another problem with refinement panel. It seems that it displays only limited number of refiner element with large number of records. I want to show all the refiners. I changed metaDataThreshold and noFilterCount. But it doesn’t work for me.
Hi Achini,
I have found out that in SharePoint Search you will only get refiner counts up to a maximum of 500 items, regardless of how many results are in the result set.
If you want counts for all of the result set then you will need to purchase FAST Search.
ya. You are correct. By using deep refiners in Fast Search for sharepoint, I could figure out the refiner count problem.
But the other issue is still exists.
I am using Fast Search for Sharepoint. For one refiner category (say “owner” ), I can see only 100 refiner elements. But it should return more than that. Is there any parameter I should change to get all refiner elements ?
Thanks for the great information. I am following your steps but I am getting this error -Validating filter config XML: The ‘FilterCategories’ start tag on line 1 does not match the end tag of ‘Category’. Line 1, position 3113. after applying the changes. I am working with the code in notepad and then copying and pasting the enter thing back into sharepoint. I am only added the ShowCounts=”Count” after each category. What am I missing? I appreciate the help.
Hi,
Thanks for the article, pretty straight forward, but I m finding it difficult to my refiners to Show the Count.
I have edited the SearchResult.aspx page in SharePoint designer, and added ShowCounts=”Count” in the standard category “Result Type”, but in my results I m not getting the Item counts at all.
Advise me….
Hey Usman,
You dont need to edit the page in SharePoint Desinger, you simply edit the FilterCategoryDefinition XML that is attached to the web part.
Hi Michal
Sorry, I’m a bit green when it comes to this. I’m having the same issues that Ga-Hsin is having. I have ended the category xml now I’m getting errors like “Validating filter config XML: The required attribute ‘MappedProperty’ is missing.” Also, where do I add the ShowCounts=”count”?
Any help would be great!
Jake
Thanks for the article. Worked fine AFTER I unchecked the Use Default Configurator. DOOH!
I will be reading the rest of your site articles.
[...] you have counts enabled for your refiners (click here to do that ) you will see that the total number of counts might not add to the total number of [...]