Sunday, June 1, 2014

How to show site column in SharePoint 2013 search refinement panel

Scenario:

I have create one site column of choice type and i use this column in document library/lists.

I have uploaded documents and while uploading i have selected values for that site column.

Now i want to show this site column values in refinement for better search results.

HOW TO DO IT?

Solution:

Here the solution....

1. Create Crawled Property
2. Create Mapped Property and Map to the crawled property/Create a Managed Property from a Crawled Property
3. Modifying refinement panel web part

1. Create Crawled Property:

Crawled properties are metadata information that are extracted from the documents and lists during crawls.

In SharePoint, we no need to create crawled property. when we do full/incremental crawl of content source it will automatically create .

Nothing to do in this step, just run full/incremental crawl on content source.

2. Create Mapped Property and Map to the crawled property/Create a Managed Property from a Crawled Property

Go to Central Administrator --> Application Management ---> Manage Service Applications(under Service Applications) --> Click on Search Service Application.

Click on Content Sources under Crawling and select content source then start full crawl.

After that check crawled property created or not

Go to Central Administrator --> Application Management ---> Manage Service Applications(under Service Applications) --> Click on Search Service Application --> Click on Search Schema which is under Queries and Results

Now Click on Crawled Properties


Now search for column name and you can find crawl property 


Now go to Managed Properties


Click on New Managed Property


a. Specify unique name without spaces and description if any
b. Type: leave this option as default.
c. Searchable: If this managed property you want to use in search just choose this option.

d. Queryable: if you want to query on this managed property like "PropertyName:PropertyValues" then choose this option. Example FileType:doc.



e. This is very important, if you want to use this property in refinement panel then choose "yes-active" option from the choices.

f. To sort results based on this property then choose "Yes-Active" option from the choices.


g. Give some alias name for the property.


h. Now add crawled property to this managed property. Click on Add a mapping, it will open pop and display list of crawled properties, search for crawled property and select crawled property and click on OK.




i. leave remaining options as default and click OK

Now you have created managed property and mapped to crawled property also.

Now go back to search schema and search for newly created managed property and it should be look like this.

Now run full crawl on content source. Go to content sources --> select content source and start full crawl.


3.Modifying refinement panel web part
After the full crawl has completed, The final step is to update the refinement web part on the Search Results page for a Search Site.  The steps are the following:
a. Perform a simple search and it will go to search results page
NOTE: Create new site with enterprise search center template.

b. Now hit the gear on the top right of the page and select Edit Page.

c. On the left, hit the pull down next to the Refinement web part and click “Edit Web Part”.

d. The Properties for the Refinement web part will be on the right so select the Choose Refiners… button.


e. On the list of Available refiners on the left, choose the your managed property and click Add.   





f. Hit OK and that should take you back to the Search Results page where you can perform additional Edits.  Hit OK to the Refinement web Part properties dialog on the right.
g.  Check In your changes by hitting the Check In button from the Ribbon and finally Publish.



Now perform search and you can see your site column values in refinement panel also.


No comments:

Post a Comment