Published On : 29 May 2013
Today : 4 Total : 19607
This article would help in enabling SharePoint 2010 Search feature to handshake with SharePoint User Profile Custom Properties.
Using SharePoint 2010 to search the default properties of User Profile is straight forward. The critical stage would be making the SharePoint User Profile Synchronization work. There are plenty of articles on User Profile Synchronization and it is out-of-scope for the current article.
To enable default people search, start the User Profile Service and do a crawl. But this would enable the search for default properties of User Profile & not the user created Custom Properties.
We’ll move a step forward & show how a user created Custom Properties can be brought in to SharePoint search gambit.
To start with, let’s create a custom property named ‘CustomAttrib’ in our SharePoint User Profile. Add value to ‘CustomAttrib’ in User Profile and see the results in People Search.
Create Custom Property in User Profile
- In SP Central Administration page, click on Manage Service Application
- Click on User Profile Service Application. If it is not found, we can create by clicking on ‘New’ menu on the top navigation & selecting User Profile Service Application
- Click on Manage User Properties
- Type Custom Property name
- Make sure Indexed checkbox is checked
With this we have added ‘CustomAttrib’ as a Custom Property in User Profile. Lets add some value to the added Custom Property, as otherwise, it might get slipped from search crawl.
- In User Profile Service Application page, click on Manage User Profile
- Search for a user by typing a existing user in Find Profiles textbox. In the result grid, select Edit My Profile from the ECB menu and type a value in ‘CustomAttrib’ Custom Property
Map Custom Property in SharePoint Search Metadata Properties
- In Search Service Application page, click on Metadata Properties
- Invoke crawl to have the newly added Custom Properties displayed in Crawled Properties
- Click on the Crawled Properties in Metadata Properties page. Do this after the crawl is completed in the previous step
- Type the Custom Properties name (customattrib) in the search box to check if the custom property is crawled
- Create a New Managed Properties to map the Crawled Custom Property. Click on the New Managed Property in the Metadata Properties page and fill the Property Name & do the mapping by clicking on Add Mapping and selecting the newly added User Profile Custom Property
- You can test this by searching on the Person name or by the Custom Property value. For this sample we had created a Custom Property ‘CustomAttrib’ with the value ‘Custom Attrib One’