People Search: Use a custom Ranking Model to search in added Profile Properties

5 comments

When you use the out-of-the box components for searching for people, a generic search with a keyword that is included in an added Profile property will not give the results you might expect.

This is especially a problem with the out-of-the-box webpart that shows information about a person:



When you click on one of the values in this webpart, you will be redirected to the people search results page with the value you clicked passed in as the search keyword:



But this will not give you any results. This post by kgreame outlines the same problems and some of the steps he tried to solve this issue. In the comments to that post, a workaround is mentioned: map the matching crawled properties to the ContentsHidden Managed Property.
There is however an other way. In this post by Larry Kuhn, he explains how the DEFAULTPROPERTIES within the SharePoint Search work. By setting a weight of a Managed Property, you will include it in the ranking model SharePoint uses and the property is therefore added to the default properties that are searched.
SharePoint 2010 introduces the concept of Ranking Models, so the solution mentioned in that blogpost doesn’t work. We can however create our own Ranking Model. I’ve copied the information from the Ranking Model that SharePoint uses for People Search and added my own Managed Property, Expertise, with a weight of 1.0:

<?xml version="1.0" encoding="utf-8"?>
<rankingModel name="CustomPeopleRanking" id="5EA2750C-8165-4f65-BD12-6E6DAAD45FE0" description="Custom People Ranking" xmlns="http://schemas.microsoft.com/office/2009/rankingModel">
  <queryDependentFeatures>
    <queryDependentFeature pid="177" name="RankingWeightName" weight="0.5" lengthNormalization="0" />
    <queryDependentFeature pid="19" name="PreferredName" weight="1.0" lengthNormalization="0" />
    <queryDependentFeature pid="24" name="JobTitle" weight="2.0" lengthNormalization="0" />
    <queryDependentFeature pid="39" name="Responsibilities" weight="1.0" lengthNormalization="5" />
    <queryDependentFeature pid="179" name="RankingWeightLow" weight="0.2" lengthNormalization="5" />
    <queryDependentFeature pid="175" name="ContentsHidden" weight="0.1" lengthNormalization="5" />
    <queryDependentFeature pid="35" name="Memberships" weight="0.25" lengthNormalization="5" />
    <queryDependentFeature pid="178" name="RankingWeightHigh" weight="2.0" lengthNormalization="0" />
    <queryDependentFeature pid="180" name="Pronunciations" weight="0.05" lengthNormalization="0" />
    <queryDependentFeature pid="408" name="Expertise" weight="1.0" lengthNormalization="0" />
  </queryDependentFeatures>
</rankingModel>

We can then add this Ranking Model to SharePoint with Powershell:


Get-SPEnterpriseSearchServiceApplication | New-SPEnterpriseSearchRankingModel

And paste in the XML of this Ranking Model when Powershell prompts you for it.

But how do we force SharePoint to use this Ranking Model? I’ve outlined one of the solutions in a previous post.

So after adding a web part that sets the ranking model we can perform the search again:


And bingo, the user with this value in an extra profile property shows up in the search results.

Why use this over mapping the properties in the ‘ContentsHidden’ Managed Property? As you can see the ‘ContentsHidden’ property is included in the Ranking Model with a value of 0.1. If you want to give more weight to a custom property or you have more properties to which you want to assign a different weight, you will need to modify the Ranking Model.

Related posts:

  1. Let the SharePoint Search web parts use an other Ranking Model
  2. SharePoint Server 2010 User Profile System
  3. 2 new worflow activities added to SP2010 Word Automation
  4. SharePoint 2010 Search: Property Restriction in Keyword Queries
  5. CSS contents showing in settings page for site based on custom template
Tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Amal
    Posted April 11, 2011 at 10:45 pm | Permalink

    Peter: I am able to change the Ranking model on the People results page successfully.

    People Matches Webpart appears in the Results.aspx page when we do a contextual search. Do you have an idea, what is the ranking model used for the results displayed by the people matches webpart and can we change the ranking model for that?

    Your suggestions would be appreciated.

    Best Regards,
    Amal

  2. Matthias
    Posted September 9, 2011 at 8:41 am | Permalink

    Hi
    How do you get the current Ranking Model xml from Sharepoint?

    Thx for help
    Matthias

3 Trackbacks

  1. [...] Dit blogartikel was vermeld op Twitter door Phil Childs, Peter Gerritsen. Peter Gerritsen heeft gezegd: Posted: People Search: Use a custom Ranking Model to search in added Profile Properties http://t.co/0fRxv95 #sp2010 #ttpi [...]

  2. [...] People Search: Use a custom Ranking Model to search in added Profile Properties 10.12.10 / 1pm [...]

  3. [...] Gerritsen takes it to another level by delving into the ranking model of the search in 2010 and explains why ContentsHidden, while easy, will give a low ranking and [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>