Saturday, April 21, 2012

How to Add Property Restriction to Advance Search?

The property you want to add must be a crawled property and is mapped to a managed property. 


Steps to add property to crawled properties.

Open Central Administration site.
Go to Application Management. 
Under Service Applications click on Manage Service Applications
Open your Search Service Application.
Click on Content Sources under Crawling in quick launch as shown below. And click "Start Full Crawl".


After crawling completes. We need to map the property to a new managed property.


Steps to Create Managed Property and Add Mapping to crawled Property

Under Search service application management screen click Metadata Properties under Queries And Results in Quick launch. As shown below. 


Click on "New Managed Property".


On New screen give a Property Name
Select Type of Property.
Click Add Mapping. On add mapping screen search for your crawled property, select it and click Ok.
Check "Allow this Property to be used in scopes"

Click Ok on New Managed Property screen.
Re-run full crawler.


Note: Re-run the full crawler so that new managed property can be used for search in property restrictions.



Steps to Add Newly created Managed Property to Property restrictions.


Open Advance search page.
Click Edit Page Under Site Settings.
Click Edit webpart (Advance Search box webpart)
Expand Properties under webpart properties as shown below.


Click on square button after Property text box as shown below.


Copy contents. Open any xml editor tool and paste that content in editor.
Find ending tag </PropertyDefs>. Add new <PropertyDef> before this as shown below.


Now Add <PropertyRef> before all </ResultType> as shown below.


Copy All contents and replace Properties with this new xml.
Click ok on Webpart properties.
Save and Check in your page.
Check your Property restriction dropdown and your new property will be available to be used in advance search

2 comments:

  1. Thanks Rehan ! This article is easy to understand and helpful.

    ReplyDelete
  2. This is a real scoop for everybody. This is an interesting blog page. I do hope you could do some more post. Good job!

    ReplyDelete

Popular Posts