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

Add a custom property in SharePoint advanced search- Step by Step:

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:

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 the 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:

 Important:
After completing the 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, 2013 and 2016 Advanced Search:
Although this article written for MOSS 2007, There is nothing changed in later versions of SharePoint. 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

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “Adding Custom Properties to SharePoint Advanced Search

  • January 17, 2017 at 5:14 AM

    I am not getting the search results even for default property restrictions like name, author with a clause ** equals** or ** not equal** .pls help

    Reply

Leave a Reply