Requirement

Customise the enterprise search center to include ‘Department’ and ‘Office’ fields in the refinement panel.

Solution

The first thing you need to do is ensure that the metadata fields exists under your search application. You can check this by going to Central Administration -> Manage Service Applications -> Search Service Application -> Metadata Properties. If they do not exists, you will need to create them.

1. To create a new Managed Property:

Create the Department Managed property.

  • Click on New Managed Property
  • Name: DepartmentRefinement
  • Type: Text
  • Mappings to crawled properties: People(Department:Text)
  • Allow Property to be used in scopes: Ticked

  • Click on New Managed Property
  • Name: Office
  • Type: Text
  • Mappings to crawled properties: People(Office:Text)
  • Allow Property to be used in scopes: Ticked

  • Adding the following code to the XML file:

  <Category Title=”Department”
Description=”Use this filter to restrict results to a specific department”
Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator”
MetadataThreshold=”5″
NumberOfFiltersToDisplay=”4″
MaxNumberOfFilters=”50″
SortBy=”Frequency”
SortByForMoreFilters=”Name”
SortDirection=”Descending”
SortDirectionForMoreFilters=”Ascending”
ShowMoreLink=”True”
MappedProperty=”DepartmentRefinement”
MoreLinkText=”show more”
LessLinkText=”show fewer”    />
<Category Title=”Office”
Description=”Use this filter to restrict results to a specific office location”
Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator”
MetadataThreshold=”5″
NumberOfFiltersToDisplay=”4″
MaxNumberOfFilters=”50″
SortBy=”Frequency”
SortByForMoreFilters=”Name”
SortDirection=”Descending”
SortDirectionForMoreFilters=”Ascending”
ShowMoreLink=”True”
MappedProperty=”Office”
MoreLinkText=”show more”
LessLinkText=”show fewer”    />

  •  Click Ok to close the editor
  • Uncheck the box –
  • Save all your changes.

Your people refinement panel should now look something like this:

Tagged with:
 

Leave a Reply

%d bloggers like this: