Changing the displayed labels for refinement filters RRS feed

  • Question

  • How can I change the refinement panel XML to display user-recognisable names (e.g. 'Accounts', 'Sales' etc.) for file shares instead of \\server\share1, \\server\share2 etc.?

    This is the current XML section as a reference:

    <Category    Title="Network Share"    Description="Where this document is from"    Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator"    MetadataThreshold="1"    NumberOfFiltersToDisplay="4"    MaxNumberOfFilters="20"    ShowMoreLink="True"    MappedProperty="sitename"    MoreLinkText="show more"    LessLinkText="show fewer"    ShowCounts="Count" />

    Thanks, Shane

    Wednesday, August 31, 2011 1:02 PM

All replies

  • Shane,

    unfortunately this is not possible at the moment by just editing the xml of the refinement webpart. Normally (with SharePoint Search), you could do this with valuemappings (see this post by anita boerboom). But according to this MSDN article, this is not possible with Fast, at the moment: "ValueMapping   Can be specified only for SharePoint Server search."

    I did test this with FS4SP RTM as well as with SP1, and it did, indeed, not work :(

    A solution may be to write a custom pipelin extension.
    • Proposed as answer by Bas Lijten Thursday, September 1, 2011 6:59 AM
    • Unproposed as answer by S h a n e Thursday, September 1, 2011 8:40 AM
    • Proposed as answer by Mikael SvensonMVP Thursday, September 1, 2011 9:31 AM
    • Unproposed as answer by S h a n e Thursday, September 1, 2011 9:36 AM
    Thursday, September 1, 2011 6:36 AM
  • Hi Shane,

    You can extend your pipeline, and create a new module that will uniquely translate a content source to a different string.

    Input: content source / url cp

    Output: divisionname cp -> map to divisionname managed property (+ refineable, and refine this)


    if (url.contains("server\share1") {

    name = "Accounts"


    return name;


    Amir Ben Ari

    Thursday, September 1, 2011 6:57 AM
  • Hi Bas,

    hmm...how come it is (appears to be) possible on the Modified Date then?

    <Category    Title="Modified Date"    Description="When the item was last updated"    Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator"    MetadataThreshold="1"    NumberOfFiltersToDisplay="6"    SortBy="Custom"    ShowMoreLink="False"    MappedProperty="write"    ShowCounts="Count" >    <CustomFilters MappingType="RangeMapping" DataType="Date" ValueReference="Relative" ShowAllInMore="False">      <CustomFilter CustomValue="Past 24 Hours">        <OriginalValue>-1..</OriginalValue>      </CustomFilter>      <CustomFilter CustomValue="Past Week">        <OriginalValue>-7..</OriginalValue>      </CustomFilter>      <CustomFilter CustomValue="Past Month">        <OriginalValue>-30..</OriginalValue>      </CustomFilter>      <CustomFilter CustomValue="Past Six Months">        <OriginalValue>-183..</OriginalValue>      </CustomFilter>      <CustomFilter CustomValue="Past Year">        <OriginalValue>-365..</OriginalValue>      </CustomFilter>      <CustomFilter CustomValue="Earlier">        <OriginalValue>..-365</OriginalValue>      </CustomFilter>    </CustomFilters>  </Category>

    If the above mechanism can't be used for the list of file shares in the refinement panel, is it possible to refine - via the refinement panel - by content source?

    Thanks, Shane

    Thursday, September 1, 2011 8:40 AM
  • Because the RangeMapping filter supports it.

    If you don't want to use the custom pipeline extensibility to do your mapping, you can achieve the same by modifying the XSLT of the refinement webpart, doing your string replacement there instead.

    Mikael Svenson 

    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    Thursday, September 1, 2011 9:33 AM
  • Hi Mikael,

    yes I'd prefer not to use the custom pipeline extensibility as it seems like a very big hammer to crack a very small nut. In the XSLT would it be the DisplayName variable that needs to be modified?

    Thanks, Shane

    Thursday, September 1, 2011 10:37 AM
  • DisplayName seems to be the right one yes :) And there are many string-replace templates for xslt out there.


    Search Enthusiast - SharePoint MVP/WCF4/ASP.Net4
    Thursday, September 1, 2011 8:08 PM
  • Hi Mikael,

    in my next life I'm going to be an XSLT guru but for now...I still can't get it to work. Any pointers would be much appreciated.

    Thanks, Shane

    Friday, September 2, 2011 3:20 PM