SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。

huangapple go评论49阅读模式
英文:

SharePoint PnP Modern search not working with refinable string for hub site

问题

我有一个SharePoint在线中心站点,关联了大约100个站点。我正在使用PnP现代搜索,我希望搜索可以在refinablestring上工作,它映射到文档类型,这是内容类型选择列,文档库是从所有站点使用相同的内容类型创建的。

问题是,当查询模板包含refinable string时,搜索不会搜索与关联站点的项。我有以下查询:

{searchTerms} RefinableString05: Bulk Data
Path:"https://dummy.sharepoint.com/sites/myHub"

我希望这将返回中心站点和所有关联站点的结果,其中我的refinablestringBulk Data

当前它只返回中心站点的结果,而不是关联站点,如果我删除refinablestring,查询将搜索所有站点(中心站点和关联站点)。

可以有人帮助我解决这个问题吗?我已经被困在这里好几天了。

英文:

I have sharepoint online hub site and around 100 sites associated to hub site. I am using PnP modern search, I want search to work on refinablestring, it is mapped to document type which is content type choice column, Document library is created from same content type for all sites.

The problem is search do not search items from the associated sites when query template contains refinable string. I have below query

{searchTerms} RefinableString05: Bulk Data
Path:"https://dummy.sharepoint.com/sites/myHub"

I expect this to return the results from the hub site and all associated sites where my refinablestring is Bulk Data

Currently it return the results only from hub site not the associated sites, the query searches for all sites(hub and associated sites) if I remove the refinablestring

{searchTerms} 
Path:"https://dummy.sharepoint.com/sites/myHub

Can someone please help me on this, I am stuck on this for couple of days.

答案1

得分: 0

结果是预期的。当您在查询中添加了Path时,只会获取具有此URL的项目。由于子枢纽站点的URL与父枢纽不同,这些项目将不会返回。

但是有一个解决方案!

您必须添加一个RelatedHubSites,其中包含父枢纽的ID。此ID也可通过令牌{Hub.HubSiteId}获得。对于RefinableString05,您还必须在“选定属性”下拉列表中进行检查。

{searchTerms} RefinableString05:"Bulk Data"
RelatedHubSites:{Hub.HubSiteId}

SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。

请查看以下文章:

对于我的测试:"Test Communication"是父枢纽,“Template Team"是子枢纽。当搜索文档"File1"时,只有在枢纽内的站点才会返回。如果我删除筛选器,将显示更多结果。我还在作者名称下添加了RefinableString05的值。

SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。
SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。
SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。

英文:

The result is the expected one. As you add a Path in your query, you will only get items with this URL. As the child hub sites have not the same URL than the parent hub, these items will not be returned.

But there is a solution!

You must add a RelatedHubSites with the parent hub id. This id is also available with a token {Hub.HubSiteId}. For the RefinableString05 you also have to check it in the "Selected properties" dropdown list.

{searchTerms} RefinableString05:"Bulk Data"
RelatedHubSites:{Hub.HubSiteId}

SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。

Check these articles:

For my test: "Test Communication" is a parent hub and "Template Team" is a child hub. When searching a document "File1", only sites within the hub is returned. If I remove the filter, more results are displayed. I also added the value of RefinableString05 below the author name.

SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。
SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。
SharePoint PnP Modern search不与Hub站点的可筛选字符串一起工作。

huangapple
  • 本文由 发表于 2023年7月20日 21:38:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76730483.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定