英文:
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"
我希望这将返回中心站点和所有关联站点的结果,其中我的refinablestring
是Bulk 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}
请查看以下文章:
- https://microsoft-search.github.io/pnp-modern-search/usage/search-results/tokens/#site-web-hub-etc-tokens
- https://github.com/microsoft-search/pnp-modern-search/issues/759
对于我的测试:"Test Communication"是父枢纽,“Template Team"是子枢纽。当搜索文档"File1"时,只有在枢纽内的站点才会返回。如果我删除筛选器,将显示更多结果。我还在作者名称下添加了RefinableString05
的值。
英文:
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}
Check these articles:
- https://microsoft-search.github.io/pnp-modern-search/usage/search-results/tokens/#site-web-hub-etc-tokens
- https://github.com/microsoft-search/pnp-modern-search/issues/759
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论