Showing posts with label Peopl Search. Show all posts
Showing posts with label Peopl Search. Show all posts

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:




People Search Results Return 404 - peopleresults.aspx is missing.

People Search Results Return 404 - peopleresults.aspx is missing.


If you've turned on SharePoint publishing features and used a publishing page to house your people search web part, you got an HTTP 404 Page Not Found error.

If you can delete the "Basic Search Center" and create a new "Enterprise Search Center" you can resolve the issue. However if it is not your intention to create an Enterprise Search Center you can create th epeoplesearch.aspx page manually. Here is how:


  • Please create a new page by going "Site Actions", and "New Page"


  • You need to call this page "peopleresults"
  • This action will create a new page called "peopleresults.aspx" in the site pages liblary.
  • I suggest that you should create a basic two column 1 row table here. First column will host the search filter web part and second one will show the people search results. 
  • Please select Insert -> Table -> 2x1 Table.
  • Set the first column width to 150 pixels


  • Please locate you cursor in the first column and add "People Refinement Panel" web part by going "Editing Tools" -> "Insert" -> "Web Part" -> "People Refinement Panel".

  • Now you can locate you cursor in the second column do the same thing for "People Search Core Results" web part by going "Insert -> Web Part" under "Editing Tools"

  • You can remove the table borders while the cursor is in the table by going to "Table Tools" -> "Design" -> "Styles" -> "Table Style 1 - Clear". Here what you will get after:

  • Now you can save and close the page. At this stage the results page will show nothing which is normal. However if you do a people search you will get following result: