2

In our current SP2013 project, we're using AD Import to import data from the AD to the user profiles. Now I want to add some more information from the user profile to the search results of the people search. So far I've successfully changed the display template for the people item to include the WorkPhone for example.

Now I want to include the Office (room) into the result. When looking at the properties of an AD user, this is the field General tab -> Office.

The AD import to SharePoint apparently works, because the user profile contains the value I entered in the AD. Here this is in the property "Office" (User Profile Service Application -> Manage User Properties).

But now I'm not sure how this property can be mapped to the SP2013 search (to a managed property which I can then include in the display template).

In the Search Service Application -> Search Schema, there is no crawled property "Office", and also no managed property of that name. There is a crawled Property "People:Office" which is mapped to the managed properties "OfficeNumber" and "ContentsHidden". I included both in the display template, but the template seems to find no values for them (I'm logging the values found in ctx.CurrentItem to the javascript console, but there are no values for either property, in fact, neither appear as properties on the ctx.CurrentItem object).

There is also a managed property "BaseOfficeLocation" which maps to the crawled property "People:SPS-Location" but this is not the one I want.

So, my question is: Does anyone know how the property "Office" in the user profile service application is mapped to the search managed properties?

1 Answer 1

2

The following applies to any property in the User Profile. If you navigate to the Manage User Properties page of the User Profile Service Application you will see the list of all properties. As you have discovered the Department, Office, and Office Location properties are all candidates for storing employee location information, so you need to check with your Active Directory team to determine where IN AD they are actually storing the info. In my case the Office property is mapped to the AD field "physicalDeliveryOficeName".

Next, search crawled properties use the internal name of the UPA properties, so you need to select Edit on the UPA property and look at the Name field. In my case the field with the Display Name "Office" has an internal name of "Office". (Where if you look at Department it is SPS-Department.)

Armed with the correct UPA property name you can now find the Crawled Property under the People category in Search Schema. People:Office. In my case this was mapped to a Managed property "OfficeNumber". You can use OfficeNumber in your search results (or create a new managed property if the mapping does not exist, or map the crawled property to an existing managed property.) Generally I try to use the out of the box properties if they suit my needs before creating a new one, even if the names don't quite match.

3
  • 1
    Ok, this makes sense. I was looking for a crawled property "Office" but there was none. Now I understand that those (User Profile) properties are preceded with "People:". But: when I add the corresponding properties to my display template (under mso:ManagedPropertyMapping), like "OfficeNumber":"OfficeNumber", then I still do not get a value for it. I'm logging all values I find in the ctx.CurrentItem to the console, and it does not have an OfficeNumber value. I did a full crawl inbetween, and made sure the profile has a value in the field. But it is not found in the display template.
    – D.Ogranos
    Feb 13, 2015 at 8:46
  • 2
    Return to the Result Type Rule page, some times your properties need to be "refreshed" and there will be a message on the page indicating this. Also, you have to define this Managed Property in the SSA. You can't map these properties in the Site Collection. Feb 14, 2015 at 21:21
  • This was the thing I had been missing! Klicked the refresh link in the message and now the properties are available in the display template. Thank you so much! I've marked your answer as correct.
    – D.Ogranos
    Feb 16, 2015 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.