Wednesday, May 21, 2008

Customizing the SharePoint People Search Results

A few months back I gave a presentation at the Houston SharePoint Users Group (HSUG) on how to customize the People Search Results Page. The presentation includes a brief high level walk-through on how to configure the Active Directory Profile Import to include additional Active Directory property mappings, and how to display these newly mapped properties in the search results page using the People Search Core Results web part.

You can download the presentation here.

Technorati Tags: ,

6 comments:

Srividya said...

Hi,

Your post is very helpful. I am new to sharepoint and I have a requirement in people search. I need to retrieve the person picture from a sql server database and a server where pics are stored and display in the people search.
Is it possible to customize the search?

Any help would be appreciated.

Rafelo said...

Hello Srividya, thanks for commenting. You have a number of ways to accomplish this. The approach I am going to recommend may require some coding outside of SharePoint but overall will give you more flexibility as it would be reusable by other apps.

I would create a separate aspx page to retrieve the image (such as getimage.aspx.) This page would retrieve and render itself as the image based in information that is passed into it via the querystring (i.e. getimage.aspx?userid=rperez). There are a number of articles out there that explain how to do this in .NET; one such article can be found at http://www.odetocode.com/Articles/172.aspx

Once the getimage.aspx page is created, include it as the image source in the XSL of the People Search Core Results Web Part (i.e. img src="{concat('http://webaddress/getimage.asxp?userid=', $email)}")

Hopefully this helps. Let me know if you have any further questions. I cant always respond on the same day, but I try (except maybe on weekends... and vacations)

Midhun Kumar Allu said...

Thanks for the very nice presentation.

Drew said...

Hi Rafelo,

This article is fantastic and very helpful. I was wondering though how would you go about doing an Alphabetical sort in the search results?

Cheerfully

Andrew

Rafelo said...

Drew, sorry about the delayed response. I wouldnt recommend using the described approach to sort search results alphabetically. Not sure I would recommend sorting search results alphabetically all together, although there are times when I've had to do it (particularly with people search results).

What Ive done in the past is use the Search Web Service (Query or QueryEx), and performed the query using SQL Syntax. See http://msdn.microsoft.com/en-us/library/ms470518.aspx Be prepared to take a performance hit, depending on how much data you expect to get back.

Aditya said...

Hi,

Presentation is very helpful. Thanks. I am trying to search people and it working fine but when I search for name like O'quinn it is not giving any results. when I type like d'a then search it will give results. Can you help me to sort out this problem.