[英]SharePoint 2013 People:Assistant returns empty when created as Managed Property
If I create a Managed Property that points to the People:Assistant
property it always returns an empty string if set to text or undefined if set to binary. 如果我创建一个指向
People:Assistant
属性的托管属性,则将其设置为text时始终返回一个空字符串,如果将其设置为binary则始终返回一个未定义。
The Assistant property is of type Person and I want to use the properties to create a link to the Assistant profile. Assistant属性的类型为Person,我想使用这些属性来创建指向Assistant配置文件的链接。
What I have done is: Fill out the Assistant field in a user Profile 我要做的是:在用户个人资料中填写“助手”字段
Create a new Managed Property called assistant 创建一个新的托管资产,称为助手
People:Assistant
People:Assistant
In the display template add Assistant to the managed properties Save everything and for good measure do a crawl. 在显示模板中,将助手添加到托管属性中。保存所有内容,并进行爬网。
Check that Assistant is set to another Person on the profile 检查助手是否在个人资料上设置为其他人
Debug the display template and check ctx.CurrentItem.Assistant
. 调试显示模板,然后检查
ctx.CurrentItem.Assistant
。 It returns "". 返回“”。
If I set the Managed Property type to binary then it returns undefined 如果我将“托管属性”类型设置为二进制,那么它将返回未定义
I have also tried ctx.CurrentItem.Assistant[0]
or ctx.CurrentItem.Assistant["PreferredName"]
我也尝试过
ctx.CurrentItem.Assistant[0]
或ctx.CurrentItem.Assistant["PreferredName"]
Can anyone point me in the right direction of how I would either return the Person object as a managed property or get a reference to it so that I can create a new Person object and access the properties 任何人都可以向我指出正确的方向,指示我如何将Person对象作为托管属性返回或获取对它的引用,以便我可以创建一个新的Person对象并访问该属性
Finally found out what I was missing. 终于发现了我所缺少的。 When setting up the managed property, set it to text and click the Advanced Searchable Settings and select PeopleIdx
设置托管属性时,将其设置为文本,然后单击“ 高级可搜索设置”,然后选择“ PeopleIdx”
Do a full crawl and the managed property will return <domain>\\<username>
which can be used to create a link to the user. 进行完全爬网,托管属性将返回
<domain>\\<username>
,可用于创建到用户的链接。
All I have to do now is work out how to return the users display name from the domain address :-) 我现在要做的就是找出如何从域名地址中返回用户的显示名称:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.