简体   繁体   English

创建为托管属性时,SharePoint 2013 People:Assistant返回空

[英]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 创建一个新的托管资产,称为助手

  1. Type: Text 类型:文字
  2. Retrievable: true 可检索:true
  3. Mapping: 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.

相关问题 SharePoint 2010 KeywordQuery返回空的托管属性 - SharePoint 2010 KeywordQuery Returns Empty Managed Properties 使用CSOM在SharePoint 2013中创建托管属性c# - Creating Managed Properties in the SharePoint 2013 Using CSOM c# 在SharePoint 2013中使用托管客户端对象模型上载文件 - Uploading file using Managed client object model in sharepoint 2013 SharePoint 2013-会话结束时重定向 - SharePoint 2013 - redirection when session ends 以编程方式更新sharepoint 2013“创建者”,“修改者”项目字段 - Programmatically update sharepoint 2013 “Created By”, “Modified By” item fields 搜索SharePoint 2013:将“结果源类型”部分设置为“人员搜索结果” - Search SharePoint 2013: set Result Source Type section to People Search Results SharePoint ListItemCollection.GetById返回空的ListItem吗? - SharePoint ListItemCollection.GetById returns empty ListItem? 登录到sharepoint 2013时将域追加或注入用户名 - Append or Inject domain into Username when logging into sharepoint 2013 当设置为ReadOnly时,SharePoint 2013主LookupField将显示ID - SharePoint 2013 Primary LookupField Shows ID when Set to ReadOnly 尝试在SharePoint 2013中运行Word Automation Services时发生异常 - Exception when trying to run Word Automation Services in SharePoint 2013
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM