In this series I am going to show you how you can add custom property from document library or list to the search refinement panel.
Search refinement panel appears left hand side when you perform a search. If you observe closely, you get to see meta data associated with the result set that is returned from the search query.
Let's say you have a document library and you search for some word. you find the result in the search results but you would want bifurcate the result based on few meta data properties of the document library, then you need to modify the search refinement panel.
Before diving into this let us have one document library with some meta data properties.
Make sure that you have the values in the field for which you want to create mapped property. Otherwise search will ignore the field and will not generate crawled property. The process is first crawl the content so that you get crawled property generally starts with ows_fieldname and then create mapped property and then use mapped property in the search page.
Coming back to the document library, we have something like this in our hand.
Now go to the central administration. Click on application management. then click on manage service applications and click on search service application. then click on content sources. now full crawl the content source local sites which generally has all the web applications.
Let the full crawl complete.
Now click on the metadata property from the quick launch on the same page. then click on the crawled property.
now search with department which is our column in the document library.
click on ows_department to verify that this is the property that we are looking for. once you click on the property, you actually get to know that where this property has been created from. This way we can be ensure that this is the correct property. On our case we can see that it is from our document library.
Now come back to the screen and click on metadata property and then click on new managed property. Give a name ManagedDepartment , click on add mapping.
now search department , you will get the crawled property and then select ows_department and then click on ok.
Now we need to crawl one more time. Full crawled the content one more time.
Let the crawl complete.
Now come back to the search result web part page. edit the page and then edit the search refinement panel web part.
Make sure that the Use Default configuration is not checked. By default it is checked. If you do not unchecked this then even you do any customization it will not get into the account.
Click on filter category definition. this opens up a text editor where we need to add our custom department property. Add following entry between categories. Make a note that ShowCounts is set to Counts and most importantly threashold value is set to 0. If this is not set to 0 that means in the search result if the property is returned for that many number of times then only department will appear in the search refinement panel. Another attribute to note is the mapped property. this is the name of the managed property that we created earlier.
And this is the result of it. We now have department appearing in the refinement panel and that too with count.
I hope this helps. In next post of this series we will see some more interesting topic for searh refinement panel.