Online Training On SharePoint
                      

Wednesday, 20 January 2010

Creating Additional Refiners in Refiner Web Part in SharePoint 2010

In SharePoint 2010 a new Refiner Web Part is introduced which is shown along the search results. This Web Part is available for both SharePoint 2010 and with FAST Search for SharePoint 2010. With this Web Part user can easily filter the search restults based on the metadata associated with the results. Any Managed Properties in SharePoint can be added as a refiner category. I will be adding a new refiner category in the Refiner Web Part using FAST Search for SharePoint 2010.

For this first we will be creating a Managed Property. I have already created a site column which I will be using as Crawled Property while creating the the Managed Property. To create Managed Property go to Central Administration and then go to the FAST Query SSA in the Manage Service Application. Inside the FAST Query SSA find the FAST Search Administration:



Now inside this click on the Managed Property Link:


Now here we will be creating a managed property. Click on the New Managed Property and a new form will be open. Specify the Managed Property name and type of data which it will be mapped to. In the Mapping to Crawled Property field click on the Add Property button. This will show all the crawled properties. Since I have created a SharePoint Site Column I will select the Category as SharePoint. My site column name was LivingLocation so I will get the Crawled Property name ows_LivingLocation. Make sure that crawling is done after creating the site column. Only then it will appear here.


Once this is done there are we need to make sure to check the refiner propery check box.


Now the Managed Property is ready and it can be added as a refiner category. A managed property can also be enabled to work as a refiner by using this PowerShell command:
Set-FASTSearchMetadataManagedProperty –Name LivingLocation -RefinementEnabled $true

Now we need to add the LivingLocation as the refiner property. To do this we need to edit the XML in Filter Category Definition in the Refiner Web Part.
<Category    Title="Living Location"  Description="Location" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="1" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" ShowMoreLink="True" MappedProperty="LivingLocation" MoreLinkText="show more" LessLinkText="show fewer" ShowCounts="Count" />
If the field type is managed metadata field we need to have the type as Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator

Once we add this XMLstring we need to make sure to change few more things in the Web Part. We need to uncheck the Use Default Configuration else the web part will not take the modified XML string.


Also we need to make sure that the number of Categories are configured properly. Refinement Panel only shows the specified number of categories which are mentioned in this field.
Post a Comment
Related Posts with Thumbnails