SharePoint Online 内容不会显示在 SharePoint 本地搜索中

问题

请考虑以下应用场景:

  • 将出站混合搜索配置为在本地 SharePoint 2013 环境中从 SharePoint Online 返回结果。

  • 当用户从 SharePoint 2013 本地网站执行查询时,仅显示来自 SharePoint 2013 本地环境的结果。 不会从 SharePoint Online 返回任何结果。

  • 管理员编辑与结果源关联的查询规则。 然后,管理员从结果块打开查询生成器。 但是,这会触发以下错误:

    1 3/4 System.Net.WebException:请求已中止:请求已取消。 -->Microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2ErrorResponseException:远程服务器返回错误: (404) 找不到。 at Microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2Client.GetResponse (Uri stsurl,OAuth2AccessTokenRequest 消息) microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2Client.RequestOAuthToken (Uri stsUrl。OAuth2AccessTokenRequest 请求) at stslnfo,OAuth2EndpointIdentity endpointldentity) microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2SecurityTokenManager.GetRawBearerToken (String nameldentifier, SPSecurityTokenServiceConnectionInformation stslnfo。

此外,统一日志记录服务 (ULS) 日志中记录了以下异常:

An exception occurred during OAuth2 request to <url specific to your site>
The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2Client.GetResponse(Uri stsUrl,
OAuth2AccessTokenRequest message)

解决方案

若要解决此问题,请确定是否在分区模式下部署了搜索服务应用程序代理。 如果是,请删除代理,然后在不使用分区模式的情况下重新创建代理。

笔记

  • 当以分区模式部署本地搜索服务应用程序代理时,Microsoft 365 不支持传入混合搜索查询。

  • 在遵循这些步骤之前,请遵循最佳操作做法并执行备份。 有关详细信息,请转到在 SharePoint Server 中备份搜索服务应用程序

为此,请在 SharePoint 命令行管理程序中执行以下步骤。

  1. 获取 Search Service 应用程序的 ID。 为此,请运行以下 cmdlet:

    $ssa=Get-SPEnterpriseSearchServiceApplication
    
  2. 获取搜索服务应用程序代理的 ID。 为此,请运行以下 cmdlet:

    $ssaproxy=Get-SPServiceApplicationProxy –identity <guid>
    

    注意 服务应用程序代理 GUID 对于每个场都是唯一的。 运行 Get-SPServiceApplicationProxy cmdlet,并记下搜索服务应用程序代理的 GUID。

  3. 查看 $ssaproxy.properties 结果。 代理应列为已分区。 如果是这种情况,请转到步骤 4 以更新代理属性。

  4. 更新代理属性。 为此,请运行以下 cmdlet:

    $proxy = get-spenterprisesearchserviceapplicationproxy
    $proxy.Properties["Microsoft.Office.Server.Utilities.SPPartitionOptions"] = 0
    $proxy.Update()
    $ssa = get-spenterprisesearchserviceapplication
    $ssa.SetProperty("IgnoreTenantization",1)
    $ssa.Update()
    

    完成这些步骤后,检查问题是否已解决。 否则,请转到步骤 5 以删除并重新创建代理。

  5. 删除搜索服务应用程序代理。 为此,请运行以下 cmdlet:

    Remove-SPServiceApplicationProxy $ssaproxy
    
  6. 创建新的搜索服务应用程序代理。 为此,请运行以下 cmdlet:

    New-SPEnterpriseSearchServiceApplicationProxy -SearchApplication $ssa -Name "Search Service Application Proxy"
    

执行这些步骤后,SharePoint 2013 本地搜索场应开始从 SharePoint Online 返回结果。

更多信息

有关详细信息,请转到 了解 SharePoint Server 2013 中的多租户

仍然需要帮助? 请转到 SharePoint 社区