December 27, 2009

SharePoint People Search Autocomplete

Back in July, Jan Tielens demonstrated how to write an autocomplete mechanism for SharePoint search. Muhimbi then proposed a greatly enhanced version 2.

In our version, we have enhanced the code just a little to enable the following:

  • paging: you can display results n at a time, and offer a link to go to the next page

Next

  • sorting: allow users to refresh results by alphabetical order, by department, etc. (you can add your own sorting criteria)

SortBy

  • search across all people metadata:  let people either search on name, skills, office number, phone number, or any other indexed metadata you include in the search query

Terms

  • Rich formatted results: display picture, presence awareness (Office Communicator) and links to internal or external systems (Yammer, Skype, Facebook, etc.)

RichResult

  • Refine search results: allow users to click on any metadata on the autocomplete search to drill down into specific criteria

drilldown

Example of the final result:

PeopleAutocomplete

To implement this version of the people search autocomplete, copy the code below, modify it as you need (mandatory: modify the server name), and paste it on a Content Editor web part.

5 comments:

  1. Hi,

    This is great. I am not so good with Javascript, but is there a possibility to somehow group the results by, for example, searchscope?

    Thnx,

    Kevin.

    ReplyDelete
  2. Hi,

    I have tried your code below but in the code file there are no comments about how your query was structured or anything of the sort.
    Can you please send me a breakdown of where you got the user info as well as how the info is retrieved from SharePoint. I am relatively new to this.

    ReplyDelete
  3. My favorite tool to build my XMl Queries is this codeplex tool: http://sharepointsearchserv.codeplex.com/
    Hope this helps.

    ReplyDelete
  4. Hi ,
    I am not able to find the script for people search.Ca you please provide the link to get the script

    ReplyDelete
    Replies
    1. It's the yellow folder at the end of the post. Or use this URL: https://skydrive.live.com/redir.aspx?cid=4b4456f418bc36f2&resid=4B4456F418BC36F2!1830&parid=4B4456F418BC36F2!722&authkey=!

      Delete