[socialwrap align=”left”] [socialicon name=”fb” url=”” ][/socialicon] [socialicon name=”linkedin” url=”” ][/socialicon] [socialicon name=”twitter” url=”” ][/socialicon] [socialicon name=”google” url=”” ][/socialicon] [socialicon name=”rss” url=”” ][/socialicon] [socialicon name=”youtube” url=”” ][/socialicon] [socialicon name=”vimeo” url=”” ][/socialicon] [socialicon name=”pinterest” url=”” ][/socialicon] [socialicon name=”soundcloud” url=”” ][/socialicon] [socialicon name=”instagram” url=”” ][/socialicon] [socialicon name=”flickr” url=”” ][/socialicon] [socialicon name=”email” url=”” ][/socialicon] [/socialwrap]
The goal of this exercise is to add/modify the refinement panel web part on a search results page in SharePoint 2010. No code required. Keep in mind that customization of the OSSSearchResults.aspx page is unsupported. So in my example, I created a Search Center site, and pointed my contextual search to the Search Center. This way I can customize the search results page.
Step 1 – Create Site Column
Create a site column(s) in the site where the items that will use the property are stored. In my case I created a lookup column to a list that returned the Title of the list item called Entity Lookup.
Step 2 – Add Site Column and Map to Content
Next we need to create a document library and Add an Existing Site Column. It is not required to add the column to content types, but this will provide the ability to edit the column in Edit Properties modal dialogue window. Be sure that you have a number of items that use this property and have a value added or the refinement will not show up with the search results.
Step 3 – Perform a Full Crawl
I will explain why we do this in the next step. You may be able to do an incremental crawl, but the first time I tried it, this did not work. After that, I just did a full crawl for good measure. Obviously in production, you may have to wait until the next crawl to proceed. To do this go to Central Admin->Manage Service Applications->Search Service Application->Content Sources->Drop Down the Content Source and say Start Full Crawl.
Step 4 – Verify Crawled Property and Add Managed Property
First verify that after the crawl, the column(s) that were added are listed as a crawled property. To do this go to Central Admin->Manage Service Applications->Search Service Application->Metadata Properties->Crawled Properties. In the search box type in “ows_[column name]” and click find. The result will depend on what type of column created and how long the name is. If it is a multi-word column name, just use the first word in the search. In my case the crawled property is ows_Entity_x0020_Lookup.
Initially, there will be no value in the Mapped To Column. Once you verify that the Crawled Property Exists, select Managed Properties link at the top of the page.
Choose New Managed Property. Give it a name and a type. In my case I call it Entity and give it type Text. Next choose Add Mapping:
Search for the Crawled Property you just verified and click ok. I set the following options on the managed property and then click ok to create it.
Step 5 – Perform another Full Crawl
See Step 3.
Step 6 – Modify Refinement Panel
In my case I created a Search Site in the same site collection as the documents, but as long as the Search Page has access to the scopes that this content lives you are ok. The other advantage to a Search Site is that the Search page is already built and linked up. On the search page, click Edit Page. Then Edit the Search Refinement Web Part.