Forum Discussion
How to enrich a result source with a managed property?
- Jan 22, 2019I don´t know any other way. Well, to be honest, you could develop a webjob/Azure function that once a day get all your user profiles, read the Manager property, and then update a custom UP property with the Full Name (then you mapped your search to this property). Obviously is much work.
The JavaScript path is not an easy one either, as you have to do an async call to the user profile REST API to get the Full name, and that´s not easy inside display templates. At the end of this post, a guy is sharing a piece of code that he says is doing the work, and renders a Lync presence card…
https://social.technet.microsoft.com/Forums/office/en-US/9ce7803b-d5ec-4374-a364-2e917c44acdd/display-the-managers-name-in-people-search-results-using-display-templates?forum=sharepointgeneral
Hi,
not sure if I´m understanding. To extend the People results, you need a new User Profile property. That property can be just a plain string, or if you want a predefined set of values, you have to create a new TermSet (or re-use and existing one), and create the user profile property mapped to that TermSet (can´t be mapped to a SP List). Then, add some values to some user profiles, and wait for some time, as the search crawler needs to crawl the new data, and will create a new Crawled property (usually the name of the crawled property will be something like "People:NAME_YOUR_USER_PROFILE_PROPERTY"). You mapped the RefinableString111 to that People... crawled property, and then it should work in the Refiners panel. Ensure to add some values to some user profiles, otherwise the crawled property won´t be created.
Hope it helps.
Thanks! The reason why I have been hesitant to go the user profile property route is that the property actually already exists but in the wrong display name format.
It's actually "People:Manager" user profile property. Unfortunately, when mapping this to a manged property and using it as a refiner, the refiner display name will look like: "i:0#.f|membership|firstname.lastname@contoso.com".
Since I was unable to adapt the refiner display template (lack of Javascript skills) to change the display name to "Firstname Lastname", I thought of this workaround. That's why I created a list of all managers trying to enrich the Local People Results content source with it in order to avoid having to create a duplicate user profile property.
I guess I'll have to try the display template route again or do you know of another way?
- Luis MañezJan 22, 2019MVPI don´t know any other way. Well, to be honest, you could develop a webjob/Azure function that once a day get all your user profiles, read the Manager property, and then update a custom UP property with the Full Name (then you mapped your search to this property). Obviously is much work.
The JavaScript path is not an easy one either, as you have to do an async call to the user profile REST API to get the Full name, and that´s not easy inside display templates. At the end of this post, a guy is sharing a piece of code that he says is doing the work, and renders a Lync presence card…
https://social.technet.microsoft.com/Forums/office/en-US/9ce7803b-d5ec-4374-a364-2e917c44acdd/display-the-managers-name-in-people-search-results-using-display-templates?forum=sharepointgeneral