Tuesday, May 8, 2012

Adding Custom Properties to SharePoint Advanced Search

Requirement: We had a metadata column called "Service" in many document libraries & lists. End-users wanted to perform Searches based on the metadata column.

Solution: We can add custom properties to SharePoint's Advanced Search page by following these  steps:
                      A. Add Metadata Property Mapping
                      B. Customize Advanced Search
                      C. Trigger Full Crawl

Detailed Steps to Add custom property in SharePoint advanced search:

A) Add Metadata Property Mapping

1. Go to Central Administration >> Shared Service Provider >> Search Administration >> Metadata Properties
sharepoint advanced search custom property

2. Click on "New Managed Property" under Metadata Property Mappings.
sharepoint advanced search add custom property
3. Name the Property, say "service", Enter the optional description, Choose the Data type of the property, select "Include Values from a single Crawled Property based on the order" and then click on "Add Mapping" button.
sharepoint 2010 advanced search custom properties
4. In the Crawled Property Selection window, Select the Category as "SharePoint" , enter the column name, Pick it from the list and click on "Ok"
sharepoint 2010 advanced search custom fields
5. Click on "OK" button to finalize the Metadata mapping.
advanced search for custom columns sharepoint 2010


B)Edit Advanced Search Page:

1. Edit the Advanced Search Page, usually it will be located at: /SearchCenter/Pages/advanced.aspx
enable advanced search for custom columns sharepoint 20102. Click on Modify Shared web part of "Advanced Search Box" Web Part.
sharepoint 2010 search custom columns
3. Expand the Properties Node and then click on Square button as in this picture.
sharepoint 2010 add custom column search
4. That will open  window with default XML. Copy-Paste the XML to SharePoint designer for easy editing, Add the entries to <PropertyDefs> and in <ResultTypes><ResultType> nodes

<PropertyDef Name="Service" DataType="text" DisplayName="Service"/> 

<PropertyRef Name="Service" />
sharepoint search on custom columns
5. See the new column added to properties drop down in Advanced Search page! so we successfully brought custom properties to SharePoint advanced search!!
sharepoint search by custom columns

C) Trigger Full Crawl:

After completing above steps trigger the Full Crawl in Search Administration.

sharepoint 2010 advanced search webpart metadata
Otherwise, You will receive an Error message when you try to search:
"Property doesn't exist or is used in a manner inconsistent with schema settings."
sharepoint 2007 search custom field
Update: Add Custom Properties to SharePoint 2010 advanced search:
Although this article written for MOSS 2007, There is nothing changed in SharePoint 2010. The only thing is: Search is moved to Service application from SSP.

So, in SharePoint 2010, you launch Search administration by going to:
Central Administration >> Application management >> Manage service applications >> select Search Service Application >> and then click Manage from the ribbon

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...