Tuesday, October 16, 2012

People Search in SharePoint 2010

People Search Box Web Part in SharePoint 2010



People Search is one of the great and useful features of SharePoint 2010. By using people search feature of the SharePoint 2010 users can find their co-workers not just by their names, by their hobbies, interests, department, job title, knowledge and expertise as well.

In this blogbost I would like to show you how you can enable the SharePoint People Search web part and customize it. So let's get started.

If you have a brand new SharePoint 2010 farm or you have not configure the search in your SharePoint 2010 platform, this is something you need to take care first. Here is how:
  • You need to visit the SharePoint central admin and locate your content sources under the search service application by clicking "Application Management", "Manage Service Applications", "Search Service Application" and "Content Sources".
  • If this is a new instance you'll probable have one item called "Local SharePoint sites". Please click this content source and edit.
  • In this page you need to make sure sps3://MySiteRoot item is in your start addresses list. 
  • You alse need to scheudle the full and incremental crawl in this page and check "Start full crawl of this content source" before clicking "Ok.
  • At this time you'll see the following screen:
Once this is completed, now you can insert SharePoint 2010 People Search Box web part into any page you desire. In my example I am placing the web part right into the SharePoint home page. 
  • First you will edit the page by going "Site Actions", "Edit Page"
  

















  • Then you can select "Insert", "Web Part" by going "Editing Tools" ribbon.
  • You will chose "People Search Box" web part under the "Search" category of web parts. 


  • Once the People Search Box web part is added tot he page then we can configure the web part selecting "Edit Web Part" from the web part drop down menu.
  • While you are editing the web part, you can have scopes drop down menu and select which search scope you'd like to use and in which format. In this blog post since I will be showing the People Search, I am not including the "Scopes" drop down menu.
  • You can configure the Query Text Box, by assigning a label, fixing it's size, and defining the text box prompt string.


















  • Query suggestions is a great way to display keyword suggestions to end-user while they are typing the query. These suggestion will be created automatically by SharePoint automatically based on certain number of click-throughs. There is a daily timer job scheduled to compile the suggestions. It is called "Prepare query suggestions" timer job and it is turned on by default.  If you are testing the keyword suggestions, you probably don't have any suggestion compiled yet. You can add these suggestions manually with power shell scripts. here is an example:

$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "Jeff Armstrong"
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "John Smith"
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "Jennifer McDonald"
Start-SPTimerJob -Identity "prepare query suggestions"


  • There are many options to configure in miscellaneous section of the SharePoint People Search Box web part. Please refer to this TechNet article for further configuration options: Change properties for the Search Box Web Part (SharePoint Server 2010)
  • Once it is configured you can save the web part and save and check-in the page you are editing. This is how it will look like on the page: 




If you have done everything correctly and you have SharePoint publishing features enabled you will get a "404-Page not found" error because "peopleresults.aspx" does not exist in the Site Pages library. There are a few ways to workaround this issue. One of them is to create people results page manually. which is detailed in my other blog post called "People Search Results Return 404 - peopleresults.aspx is missing."
Here is how your results page will look like:




1 comment:

  1. Hey buddies, such a marvelous blog you have made I’m surprised to read such informative stuff.http://www.searchpeopleusa.net/

    ReplyDelete