SharePoint User Profile Custom Properties Keyword Search Problem

Using SharePoint Server 2010 and the User Profile Service, we’re setting some custom properties in addition to the default profile properties. However, when we try to search for the custom properties using a People Search the search results come back empty.

Update: skip down to see some workarounds

Situation

In our profiles, we’re adding a user’s County to their information so that we can find staff based on which county office they are in. Adding the custom property is easy enough, and it shows up fine on their profile screen.

By default, SharePoint makes those properties be keyword links that do a people search with the keyword of the link, like so: http://hostname/Search/Pages/peopleresults.aspx?k=”Iron“. Unfortunately, that search turns up no results, even when I click on the existing property.

Attempts at resolution details

When creating the profile property, I set it to be indexed. It is also replicable.

In the Search Service Application I created a custom search Metadata Property of County and added “People:County(Text)” and “ows_taxID_County(Text)” to the mappings.

This certainly helped by adding County to the sidebar of refiners in a search, but doesn’t make a blank people search find people when typing in a county name.

Doing a specific named property search (County:”Iron”) does return results so it’s definitely indexing the property. It’s just not making that property available to general keyword searching.

Editing the peoplesearch.aspx page, modifying the search web part and adding County to the Properties XML didn’t make any difference.

<Properties>
   <Property Name="LastName" ManagedName="LastName" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:LastName"/>
   <Property Name="FirstName" ManagedName="FirstName" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName"/>
   <Property Name="JobTitle" ManagedName="JobTitle" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:SPS-JobTitle"/>
   <Property Name="PersonKeywords" ManagedName="PersonKeywords" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:SPS-PersonKeywords">
      <EffectiveProperty Name="Responsibility" ManagedName="Responsibility" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:SPS-Responsibility"/>
      <EffectiveProperty Name="Skills" ManagedName="Skills" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:SPS-Skills"/>
      <EffectiveProperty Name="Interests" ManagedName="Interests" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:SPS-Interests"/>
      <EffectiveProperty Name="County" ManagedName="County" ProfileURI="urn:schemas-microsoft-com:sharepoint:portal:profile:County"/>
   </Property>
</Properties>

Help?

I’m stumped. Any thoughts?

UPDATE 1

Editing the XML on the search page was a step in the right direction, but just the wrong web part. According to this MSDN Article [How to: Change the Properties Returned in the Core Search Results] I need to add the new property to the XML that gets returned in a search result. So I added <Column Name=”County”/> to the Fetched Properties. Unfortunately, it didn’t seem to make any difference. Doing a simple search for a county name still returns no results.

UPDATE 2

Modified the XSL for the search results to show the raw XML being returned. What I saw was interesting. When I do a search for a user by name that I know has a county, the custom column for County I had added to the XML was there, but it was showing a GUID for the taxonomy ID that field was associated to instead of the string.

<All_Results>
 <DummyResult>
 <ColleagueOfColleague />
 </DummyResult>
 <Result>
 <id>1</id>
 <county>#8d4de2be-5f99-44e4-9c98-0defc6f9b762</county>
 <workid>476</workid>
 <userprofile_guid>b6c81d23-735c-4c29-a930-43a67c7557d9</userprofile_guid>
 <accountname>uwcx\will.andresen</accountname>
 <preferredname>Will Andresen</preferredname>
 <yomidisplayname></yomidisplayname>
 <jobtitle>Community Resource Development Agent</jobtitle>
 <department>CES</department>

Well that could make finding a string of text difficult if the actual data is a GUID. To change it I went back into the Metadata Properties in the Search Service admin in Central Admin and changed the mapping in the County property to remove the “ows_taxId_County” mapping and left just the “People: County(text)” mapping. This resulted in the County outputting as the correct text name.

<All_Results>
 <DummyResult>
 <ColleagueOfColleague />
 </DummyResult>
 <Result>
 <id>1</id>
 <county>Iron</county>
 <workid>476</workid>
 <userprofile_guid>b6c81d23-735c-4c29-a930-43a67c7557d9</userprofile_guid>
 <accountname>uwcx\will.andresen</accountname>
 <preferredname>Will Andresen</preferredname>
 <yomidisplayname></yomidisplayname>
 <jobtitle>Community Resource Development Agent</jobtitle>
 <department>CES</department>

BUT, it still doesn’t return a search result if I type in a county name. Even though I can see it in the XML. Not only that, but I noticed this line in the XML of the search results:

<hithighlightedsummary>Iron</hithighlightedsummary>

See the “Iron” there? That’s the name of the county. That shows up regardless of the metadata property being added to the search result XML. So now we have the county name showing up in two places in the XML and still a simple search for “iron” doesn’t turn up any results. To test it out, I built a fresh VM and added only county as a custom profile property. I did not do a metadata property mapping in the search service admin. I did not add anything to the search result XML. And yet the <hithighlightedsummary> in the search results still lists the county name in the search result XML (if I search by username, not the county name). So if the the search term is in the XML when searching by username then it should show as a search result when searching for the county name as the term, but it doesn’t. Why not?

This is looking more and more like a bug.

UPDATE 3

I can now virtually guarantee that it’s a bug.

I installed a SharePoint 2007 server and configured it similarly, adding the “County” field to the user profiles. I did not add it as a keyword search metadata, nor did I modify any XML.

In 2007 it works perfectly. A simple search for a county name like “Iron” returns users. Clicking on the link on a user’s profile page, which does a simple search, returns the same. I’m not crazy after all. Something in 2010 search is broken.

Hotfixes Tried

kb983319 – Recommended because it addresses search server. NO CHANGE

kb983497 – Recommended because it addresses user profiles and people search issues. NO CHANGE

UPDATE 4

Well MS support has completely dropped the ball on my ticket and left me hanging. But some great comments here have provided workarounds that definitely make this work, albeit with some additional configuration steps that were previously unnecessary in MOSS 2007:

Dustin Beshears provides and insightful trick: “Add mappings for the crawled properties to the ‘ContentsHidden’ managed property. Run an incremental crawl and then the search should work on Custom Profile Properties. They will be referenced in the Summary section in the results.”

Steve McDonnell provides a blog post with screenshots of this and some added XSLT.

Peter 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 offers some XML and a Powershell command to set your own weighted properties.

About these ads

About this entry