Subscribe via RSS Feed Connect with me on LinkedIn

SharePoint 2010 Search Refinement Panel Options

[ 41 ] June 10, 2010 |

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:

The full of goodness Refinement Panel

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.

Some cheap and cheerful text

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!

Accuracy Index

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:

Only 50 results are used for the calculations of refiner counts

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:

Refiners for an Accuracy Index of 300

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:

Only 6 categories of refiners appearing: Result Type, Site, Author, Modified Date, Product Category and Company Size. Where are the others?

So now if we change this value to 20 lets see what happens:

There is many more refiners now shown, in the interests of not having to scroll down the page the refinement panel has been split in two!

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:

Only 5 characters shown

Hmm very crappy, lets crank it to 25 to see what happens:

Much better with 25 characters!

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:

  1. 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)
  2. 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.

Conclusion

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!

More Links

Need more information about the refinement panel, try these links:

Tags: , , ,

Category: General

About Michal Pisarek: Michal Pisarek is the founder of Dynamic Owl Consulting and a Microsoft SharePoint MVP. View author profile.

Comments (41)

Trackback URL | Comments RSS Feed

  1. Monali says:

    Hey,
    Thanks a lot.
    Very useful artile. It helped a lot specially the accuracy index :-)

    Thanks,
    Monali

  2. Riccardo says:

    Thanks for this article, very helpful!! :-)

  3. Riccardo says:

    Just a quick note about Accurancy Index. I tried to set up the AI to 2000, but after applying the new setting the value change to 500. Is this by design? Can I change this limit via PowerShell?

    Thanks
    Riccardo

  4. Hey Riccard,
    I think that it is by design, I will have a look but I am assuming that it is a hard limit that is imposed on the web part itself.

  5. Jeff says:

    Thank you sir, this was all very clearly written. Cheers!

  6. Hey Riccardo.

    OK so the limit to the refiner counts in SharePoint Search is 500, whilst FAST Search can provide counts for all items in the result set.

  7. Jonathan says:

    This is really useful stuff. Has anyone found if there is a way to have refiners driven by the managed metadata hierarchy so search can effectively be driven from the hierarchy? Or alternatively perhaps to show the refiners in that hierarchical way.

  8. Stan says:

    Hello guys,

    can somebody tell me how to filter by several terms? I want the key filter to use AND-gating and not OR-gating, configured by default.

    Any Ideas?

  9. Hey Stan,
    Sorry I dont understand the question? When you filter using refiners you are using AND gating..
    For instance show me all documents that are word documents AND by me..

    Maybe I dont understand the question, can you ellaborate?

    Thanks

  10. Stan says:

    Hello Michal,
    thank you for response and sorry for my english :-) I’ll try to explain:

    My Termset:

    Market Sector
    |-Sector 1
    |-Sector 2
    |-Sector 3
    Area
    |-Europe
    | |-Country 1
    | |-Country 2
    | |-Country 3
    |-Middle East
    | |-Country 4
    | |-Country 5
    |-Asia
    |-Country 6
    |-Country 7

    My Documents:

    Doc1.aspx (Tags: Sector1)
    Doc2.aspx (Tags: Sector1, Europe, Country 1)
    Doc3.aspx (Tags: Sector1, Europe, Country 2)
    Doc4.aspx (Tags: Sector1, Asia, Country 7)
    Doc5.aspx (Tags: Sector1, Middle East, Country 4)

    As first I set refinement filter to “Sectro1″, then “Europe” and then “Country 1″. In spite of my filter I get all my documents shown, and not just doc2.aspx.

    Thx for help! Stan

  11. Ah I see. In order to do that you will need customize the refinement panel XLST which displays the refiners. There is an awesome article http://www.chaholl.com/archive/2010/08/20/creating-a-custom-refinement-filter-generator.aspx that is kind of what you are after but I haven’t seen anyone do this exact thing.
    However if you find a way to do this I would be really interested to know how!

  12. [...] what these refinement panels are and how they can be configured I’d suggest heading over to the SharePoint Analyst HQ blog by Michal [...]

  13. Andy says:

    Hi,

    I have a problem which is the refiner count is not match with the actual search result and I think it is not related to the “Accuracy Index” issue. Because what I am seeing is; let’s say I saw the refiner with the count (233) but when I click on it, the search result is drill down to 50 (233 -> 50!!!). It supposed to drill down to 233, right?

    Do you have any idea for the root cause?
    PS. This problem happens in FAST for SharePoint2010 with Asian language.

    Regards,
    Andy

  14. Hey Andy,
    Interesting issue, I don’t quite know what could be causing it.

    Does it always happen when you click on the refiner?

  15. jriesen says:

    So, I have literally looked at dozens of blog posts and getting nowhere in the quest to figure out why the Refinement Categories that I have added…

    1. Display in the refinement panel (Yeah, this is a good thing)
    2. When I click on the refinement links, I get “No people results matching your search were found.” (very frustrating)

    I am wondering if it has something to do with the fact that this refinement panel is on the peopleresults.aspx page. I am using columns from the user profiles so there is nothing special about them and the content has been indexed.

    Here are my refinement categories:

    Category
    Title=”Office”
    Description=”Use this filter to restrict results to a specific office”
    Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator”
    MetadataThreshold=”1″
    NumberOfFiltersToDisplay=”4″
    MaxNumberOfFilters=”10″
    SortBy=”Frequency”
    SortDirection=”Ascending”
    SortByForMoreFilters=”Name”
    SortDirectionForMoreFilters=”Ascending”
    ShowMoreLink=”True”
    MappedProperty=”officenumber”
    MoreLinkText=”show more”
    LessLinkText=”show fewer”

    Category
    Title=”Department”
    Description=”Use this filter to restrict results to a specific department”
    Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator”
    MetadataThreshold=”1″
    NumberOfFiltersToDisplay=”4″
    MaxNumberOfFilters=”10″
    SortBy=”Frequency”
    SortDirection=”Ascending”
    SortByForMoreFilters=”Name”
    SortDirectionForMoreFilters=”Ascending”
    ShowMoreLink=”True”
    MappedProperty=”department”
    MoreLinkText=”show more”
    LessLinkText=”show fewer”

    Any light you can shine on this would be greatly appreciated.

    At my wits end,
    jriesen

    P.S. sending second time because my categories were stripped out of message so I left of the opening and closing .

  16. Can you send me the actual string URL string that it is coming back with when you click on a refiner?

  17. Hmm I am actually seeing the same thing..let me have a closer look next week to see if I can find a solution but it is interesting though.

  18. jriesen says:

    Thanks for your help. I will await your answer next week. Much appreciated! :-)

  19. jriesen says:

    Just checking back in to see if you found an answer, or does this one have you stumped? Thanks!

  20. Sorry but I haven’t been able to find an answer for you :(

    Will let you know if I discover anything..

  21. jriesen says:

    Well I thank you for having a look see and trying. Sometimes SharePoint can be sooooo frustrating. If anybody comes up with a resolution, please post it. :-)

  22. gary payne says:

    I was having the same issue in using the officenumber managed metadata property inside the refinement filter querystring.

    Seems to be something odd about that particular managed property. My solution was to create a new managed property named WorkOffice, map it to the People:Office crawled property, enable the “d managed property to custom results…” setting and execute a full crawl. After that completed, I found that I can successfully use r=workoffice:christchurch as a refinement filter in the search results page url

  23. Beth says:

    Hi Michal,
    In section “User Default Configuration” #2, you state that SP will “OVERWRITE THE FILE”. I think that may be what happened to me because I’ve modified the XSLT and I keep getting the default refinement results. I made a backup of the XSLT, but even though I’ve added that back to the Filter Category Definition, it still is using the default. I’m not sure if I understand what you mean by “backup the file”. Are you referring to some other type of file than the filter category definition code?

    Beth

  24. Hey Beth,
    You are probably not unchecking the ‘Use Default Configuration’ box and that might be the reason.
    See if that works and let me know.

    Cheers

  25. DD says:

    Great Tutorial ! But I can’t get managed Metadata as a Refiner :(
    I lookd through so many Tutorials now :( May be anybody can help me ? I already made the crawled metadata properties to mapped ones and still it seems i can’t map them for the refiner :(

    Here is a snippet of my XML:

    awfully the following code works and shows “some”! metadata as refiner:

    Thanks in advance !

  26. kishore says:

    Hello Michal,

    Can you please suggest me how to hide refinement panel when there is no refinements available in search results.

    Thanks
    Kishore.

  27. [...] As you may know the Refinement Panels in SharePoint help you refine the search results in a page. They are a great tool because they allow you to customize the refinement categories which can also be categories created by the user. On the fore mentioned subject there is a great set of articles that you can find here. [...]

  28. Balaraju says:

    Hi Michal Pisarek ,

    i want to add custon fields in refinement panel ,
    how to add i am trying alot. but its not come
    pls resolve the problem
    Ex: Type:Assets ….under asstes i want some fiels like
    item1
    item2
    item3
    item4

    the above fiels are i am getting from to my project .

    how i geyt and display in refinment panel

  29. Jay says:

    The goal is to have 3 to 8 fields with drop downs and you select your options.. And then a search or filter. Then when all criteria is punched in the pages come up that match the criteria in a list view and then you click the page you want…

    I created a list with all criteria right now and some have all the same options. I want it to pull up exact results.

  30. B@L@ says:

    Hi Michal ,

    i have one issue , pls give me any idea
    i am doing sharepoinr GroupBy, i got result
    But one issue is came at single item(s) groupby is not working.
    pls can u help me .
    i am using sharepoint gridview ,
    AllowGrouping=”true”
    GroupField =”Role”
    DisplayGroupFieldName=”true” GroupFieldDisplayName=”Role”

    pls reply

  31. [...] in situation you edit the refinements internet element Xslt. You can start the exploration here: http://www.sharepointanalysthq.com/2010/06/sharepoint-2010-search-refinement-panel-options/ or [...]

  32. Luis valencia says:

    I cant make this works as expected, I am not sure if this is the normal behavior.

    Could you help me please?

    http://sharepoint.stackexchange.com/questions/30464/refinement-panel-with-content-type-does-not-show-all-content-types

  33. Hans Worst says:

    Just by extending the XSL of the Refinement Panel and adding a little javascript it is possible to select multiple Refiners via the UI:
    http://theressomethingaboutsharepoint.blogspot.com/2012/02/select-multiple-refiners-via-ui-with.html

  34. KRM says:

    This is a fantastic post and has helped me a lot when editing the refinement panel. THe one thing I am still stuck with is providing values to replace the ones in the “Site” section of the panel. Our corporate folksonomy refers to these paths differently and I would like to provide an alias for them. Any ideas on how to do that? I’ve already tried indexing multiple site columns in a managed property but with no luck.

  35. GThews says:

    I just have one question according to the Refinement Panel. Is it possible to have one refinement type activated right after loading the page?
    What I want to do is to have a pre-defined search.

    Details:
    I have one search center. On the main page the user can pre define where he wants to get his result from. For example if he wants to look for the result only on the web page or on the file server that he only gets those shown.

    As you can see on my uploaded picture there is the option “intranet…”. I want that this is checked for every search result

    http://www.gthews.com/Capture.PNG

  36. Tony says:

    I am having the same problem as Gary.

    I also spent a long time searching online about the Refine panel, and must have found dozens of links about “how to customize” and “how to add a new refinement” to the panel. Practically every result on Google about the SharePoint refinement panel are instructions about this.

    However, what I still have no idea of is who the default out of the box refinement panel works. How does it pick up which properties to refine on? It is completely different in my production and dev environments even though I restored the exact same content DB and have the same managed metadata properties. Also, if I make a copy of the page in SharePoint designed and rename it from Page.aspx to Page2.aspx, the refinement panel options change even though I am doing the exact same search on the exact same page with the exact same web part! It drove me nuts, but I decided to let it go and accept that I will never understand it.

    However, I still had my requirement to customize the refinement panel. So I put in some custom property refiners, and although one of them showed up in the panel (good) when I tried to click it, it said, “No people results matching your search were found.”

    I know exactly what is wrong, it is putting the parameter as &r=jobtitle%3DmyTitle instead of &r=jobtitle:myTitle. When I replace the URL encoding for = with the : it works fine. However, I can’t figure out how to get the refinement panel to do this behavior?

    I am also using the People Search Results page.

  37. Satish says:

    Please help me with below issue for refinement panel

    http://social.msdn.microsoft.com/Forums/en-US/f1152ffb-c845-4a34-9252-21a2565bbd59/sites-category-in-refinement-panel-of-sharepoint-2010-fast-search-not-showing-all-values?forum=sharepointsearchprevious

    I have Site A, B and C listed in search results with url http://a/ , http://b/ and http://c/.

    But refinement panel sites category only showing first two i.e A and B

    C is not visible in refinement panel

    Can somebody help?

  38. […] Metadata-driven refinement panel With the refinement, users can narrow the results of their searches and navigate to the right content faster. […]

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.