1

We've setup some taxonomy terms for use in our publishing pages. When searching within a site where pages use these terms, they show in the refinements page on the results page. However, ideally we'd like to have a little more control on how they are shown.

The screenshot below shows two of our term sets as refinements custom term set as refinements

the two customizations we'd like to make are:

  1. remove the TextBox shown when you click the "show more" link at the end of a refinement category, and
  2. Specify the order in which terms are shown in the term set, when displayed as refinments (i.e. in this screenshot we'd see (from the top) 5.4, 5.3, 5.2, show more)
  3. automatically expand specific refinements without needing to show a 'show more' link (e.g. in this screenshot we'd see (from the top) 5.4, 5.3, 5.2, 5.1, 5.0)

Are any/all of these desires possible?

Thanks in advance

Kevin

1
  • I've been looking more closely at this, and I'm wondering if it's fair to say that SortBy and SortDirection cannot be applied to Categories using type ...TaxonomyFilterGenerator? I did try the ManagedPropertyFilterGenerator approach, which works to a degree, except that the listed refinements in that category appear like red, red; blue, green, green;red instead of just red, blue, green. I found one script to separate them, but again SortBy and SortDirection don't work for this script. Any further advice?
    – QMKevin
    Apr 25, 2012 at 18:20

2 Answers 2

4

I don't think you can get rid of the textbox.

But the other two requirements may be solved by modifying the Refinement Panels Filter Category Definition. Here is the valid option for the Refinement Panel XML Schema.

SortBy="Name" SortDirection="Descending" should give you the ordering you need.
MaxNumberOfFiltersToDisplay="50" ShowMoreLink="False" should give you the expansion

3
  • MaxNumberOfFilters and NumberOfFiltersToDisplay are two different properties I think. MaxNumberOfFilters - An integer that specifies the maximum number of filters to display when the show more link in the Refinement Panel Web Part is clicked. To display all the filters, specify 0 for this attribute.
    – sween_sp
    Apr 23, 2012 at 21:00
  • Thank you, Per. I'm going to look into this deeper tomorrow (at work) and compare your answer with that from C.Marius below, then assign the answer attribute accordingly. Looking at the source of the page, I guess i can use JavaScript/JQuery to remove the text box, though it's not going to be pretty (script-wise)
    – QMKevin
    Apr 24, 2012 at 2:13
  • I've had some success with this, but not total. I'm using a custom results.aspx page, and managed to get my RefinementWebPart to NOT use the DefaultConfiguration, and now I can change the FilterCategoriesDefinition XML/XSL. I found the section for TaxonomyFilterGenerator and changing NumberOfFiltersToDisplay to 10 impacts my refinements. However, adding SortBy and SortDirection don't appear to change anything. As I mentioned, I'm using Terms setup in the sitecollection, so I'm concerned that defining my own would end up with double refinements.
    – QMKevin
    Apr 24, 2012 at 15:37
1

Yes and no. So

  1. You can implement your own Refiner inheriting (1 & 2 ) from http://www.threewill.com/2012/04/custom-search-refiners/ or http://www.sharepointanalysthq.com/2010/10/custom-refinement-filters-in-sharepoint-2010/
  2. Use something like this (use MaxNumberOfFilters and NumberOfFiltersToDisplay)

     <Category Title="Skill" Description="The skill the person has." Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="1" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="CustomSkills" MoreLinkText="show more" LessLinkText="show fewer" ShowCounts="Count" />
    
2
  • As mentioned in Per's answer above, I'm going to delve deeper into this tomorrow, but it's good to hear that what my boss wants might actually be within the realm of possibility after all ;)
    – QMKevin
    Apr 24, 2012 at 2:13
  • It will always depend on your business needs as well as your technical constraints, e.g. no-code vs. development. Many articles by Michal Pisarek (he is the undeniable expert in Search) explain the customization part. Apr 24, 2012 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.