Forum Discussion
Deleted
Jan 17, 2019How to enrich a result source with a managed property?
Hi,
in SPO we have a rudimentary people directory based on the ootb Local People Results result source. I have an additional metadata column in a SharePoint list which I would like to use as refinement values.
So I have already mapped the crawled propertiy to a managed properties (RefinableString111).
Unfortunately, they do not surface any values when setting them up in the refiner webpart:
I guess that's because in the search results webpart the result source is set to "Local People Results":
And since the values for the managed property come from list data that is contained in the "Local SharePoint Results" it is used here.
So I'm puzzled as to how I can include my RefinableString111 as a refiner acting upon the result source "Local People Results".
Is it possible to sort of "enrich" the existing result source with the managed property or create a new result source combining the two?
Or is there possibly a totally different way of approaching this topic?
Thanks for your input.
- I 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.
- Deleted
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?
- I 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
Correct Luis, I was thinking the same direction. Addition to your answer: add the mapping of the crawled property to the RefinableString111 at tenant level. Mapping it at Site collection level won't work. User profiles live at tenant level, that's why. Otherwise you are waiting for a long time and don't see it working. :-).