Monday 8 September 2014

Add Custom refiners in SharePoint

Create a site column. Ex: MyCustomColumn
use site column in a list
Select existing  Managed property, from
Site Settings --> click Search Schema
Ex: RefinableInt01

Now i am going to map MyCustomColumn to RefinableInt01
So i can use "RefinableInt01" in my search refinment web part.
Under Site Settings --> click Search Schema
Enter "RefinableInt01"
From the Property Name menu, click Edit/Map Property.
Under Alias, enter some name...You are going to use this name insted of "RefinableInt01".Ex: My Custom Refiner
On the Edit Managed Property page, click Add a Mapping.

In the Crawled property selection dialog box, use the Search for a crawled property name field to search for the crawled property that you want to map to this managed property.
In our Contoso catalog, the site column that contains the price information is called "MyCustomColumn", so enter this in the Search for a crawled property name , and then click Find.



Two crawled properties are found: ows_q_NMBR_MyCustomColumn and ows_MyCustomColumn.
but which one should we choose to map to the refinable managed property?

For all site column, one crawled property will create automatically..
Now we have to find which one is automatically created?
 ows_<something>_SiteColumnName
this format one is automatically created one.



I’ll call the other crawled property, ows_MyCustomColumn, a regular crawled property.

Now here’s the important part: When mapping a crawled property to a refinable managed property, you should select the regular crawled property!
Select the regular crawled property, and click OK. In our scenario, we’ll select ows_MyCustomColumn.

On the Edit Managed Property page, notice that the crawled property ows_MyCustomColumn has been added to the Mappings to crawled properties field.

Now initiate a reindexing.

Now under search refinement web part, you can add new refiner as You "My Custom Refiner"