There are alot of misconceptions around how to use the Refinement Panel in SharePoint 2010 which is a real shame because it is extremely powerful for out of the box configuration, let alone how extensible it might be for developers. (Did anyone like the thumbnail on this post? Refinement Panel -> Refinery picture? Get it? :) )
So in this article I am going to talk about one specific group of options within the Refinement Panel, that been the Refinement Options:
Refinement Panel Caption
This is pretty easy, its a caption that can be placed within the Refinement Panel. Combining this with the actual Web Part Chrome can lend to some interesting UI features.
Filter Category Definition
Now this is where all the good stuff can happen! I'm not going to go into it this post but I have already written how you can add counts to refiners, what the MetadataThreshold value does, how to add new refiners and will write some other things. Basically this XML file defines which refiners will be shown for result sets. But this is what is important. If you are customising this XML file then MAKE SURE THAT THE USE DEFAULT CONFIGURATION OPTION IS FALSE. Otherwise it won't work. I don't know why its implemented like this but it is so don't get frustrated!
The accuracy index number is the number of results used to calculate the refiner counts. Now this is usually not turned on in default SharePoint 2010 search (however it can be) and if the number is lower than the total result set then you might get false numbers returned for refiners.
Lets say that we have the Accuracy Index set to 50 and the total result set is 250, this is what will appear for the Result Type refiner with counts turned on:
Hmm users will look at the total results (250) and then see that only 21 word documents and 13 web pages were part of 250 results? Hmm that doesn't make sense. Well actually it does. The calculations are based not on the result set but rather the number of results specified in the Accuracy Index. So for 50 it does make sense. If we change the Accuracy Index to 300 we get a much more logical refiner count appear:
But be careful, calculating refiners does take some CPU power so try not to set it to 10,000 so that every single search always calculates refiners, try to find a balance.
Number of Categories to Display
Another common misconception is that if you define a refiner in the Filter Category XML that it will automatically appear depending on the MetadataThreshold. Well it won't if there already more refiners visible that are greater than the Number of Categories to Display. From what I can gather the refiners are basically rendered in the order they are in the XML so if you put your refiner at the end and already the refinement panel has rendered the maximum amount it won't be seen by users.
For example we are doing a search that returns 250 results with the Number of Categories to display set to 6. How many refiner options do we get? Well six or less but we know that there is more that could be shown:
So now if we change this value to 20 lets see what happens:
Cool so now we see many more refiners. Now is this a good thing? Well it depends really. The UI can look pretty bad, you could of course increase the height of the core results web part to match but just be careful. One suggestion though is that if there is a refiners that you always would like to see then define it at the very top of the Filter Category Definition file so that it will always be rendered first.
Number of Characters to Display
Finally we have this option. Now all this does is limits the amount of characters displayed in the refinement panel and if there are more characters then it will show a ... to indicate more. For my liking 16 is a little short but to demonstrate if we set this to 5 this is what we would see:
Hmm very crappy, lets crank it to 25 to see what happens:
Yep much better! So once again you have the option, make it too wide then you loose valuable real estate on the search screen, to small and users don't know what they are looking at.
Use Default Configuration
This one check box always causes issues. Basically it comes down to two things:
- If you are changing the Filter Category Definition file then you must have this checked otherwise SharePoint just uses the default (cause of much frustration)
- If you have changed the Filter Category Definition file and then enable this option again SharePoint will overwrite your file with the default. Yes OVERWRITE THE FILE, so be carefult (cause of much anger)
To me this is really bad design but what can you do, be careful and keep a copy of the file somewhere.
So there it it, quite a bit to know really and some really useful options! Let me know if you have any questions, comments or ramblings!
Need more information about the refinement panel, try these links: