Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Updating Filter Categories – Modifying the People Refinement Web Part

Reddy Kadasani

1. Open PeopleResults.aspx page in edit mode

image

 

2. Click on the refinement panel drop down and click on Edit Web Part

image

3. On the People Refinement Panel Editor, expand the Refinement panel

image

4. Click on the Elipses (…) on the Filter Category Definition

image

5. Change the FilterCategories XML

Copy the XML from the editor window (step 4) into an XML editor such as notepad++

Add the categories you wish to add to the XML. For example:

a. Adding a non-taxonomy field:

<Category   Title=”Location”
Description=”Use this filter to restrict results to a specific Office”

Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator”
MetadataThreshold=”5″
NumberOfFiltersToDisplay=”4″
MaxNumberOfFilters=”50″
SortBy=”Frequency”
SortDirection=”Descending”
SortByForMoreFilters=”Name”
SortDirectionForMoreFilters=”Ascending”
ShowMoreLink=”True”
MappedProperty=”OfficeNumber”
MoreLinkText=”show more”
LessLinkText=”show fewer”/>

b. Adding a taxonomy field

<Category    Title=”City”
Description=”City”
Type=”Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator”
MetadataThreshold=”3″
NumberOfFiltersToDisplay=”4″
MaxNumberOfFilters=”50″
ShowMoreLink=”True”
MappedProperty=”ows_MetadataFacetInfo”
MoreLinkText=”show more”
LessLinkText=”show fewer”/>

Refer to: http://msdn.microsoft.com/en-us/library/ff625183.aspx for the description of the filtercategory schema

Note: For taxonomy fields the Title refers to the column name of the taxonomy field. There is no way (atleast I could not figure a way to change the display name on the refinement panel for taxonomy fields through th filter category XML, maybe you can do it via jQuery)

For non-taxonomy fields, The Title refers to the name you will see on the refinement panel. MappedProperty is the name of the Manged Property

c. After you are done making the change, copy this back to the editor (step 4)

d. save the peopleresults.aspx file and check it in

e. run a people query and you will see the properties show up in the refinement panel (this is assuming you have data in those user properties and they have been crawled)

f. If you don’t see the property or you get an error (Property is being used in a format inconsitent ..blah blah..) then you have an error in the XML or the property name is in correct or not been created. You should create managed properties and map them to the crawled properties for custom fields you want to display in the refinement panel.

h. If everything looks good and you still don’t see the properties in the refinement panel, then run a reset index on the query ssa and run a full crawl.

6. Modify the managed property mapping (Enable scoping)

If you are mapping no taxonomy fields in the refinement, an additional step to do is to enable scoping on the managed metadata property

image

Powershell: You can use the following powershell script to update this property as well.

$prop =  Get-SPEnterpriseSearchMetadataManagedProperty –SearchApplication <query service> –Identity <Managed Property Name>

$prop.EnabledForScoping = $true

$prop.Update()

7. Recrawl

Run a recrawl, check out PeopleResults.aspx. You should now have your new refinements in the refinement panel

References:

http://msdn.microsoft.com/en-us/library/ff625183.aspx

http://msdn.microsoft.com/en-us/library/ee819920.aspx

http://msdn.microsoft.com/en-us/library/ff625185

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\