Remove-SPEnterpriseSearchQueryScopeRule

删除查询结果范围规则。

语法

Remove-SPEnterpriseSearchQueryScopeRule
      [-Identity] <ScopeRulePipeBind>
      -Url <Uri>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-Scope <ScopePipeBind>]
      [-SearchApplication <SearchServiceApplicationPipeBind>]
      [-WhatIf]
      [<CommonParameters>]

说明

将搜索服务应用程序升级到 SharePoint Server 后,可以查看共享范围,但不能创建、更新或删除它们。 因此,您不能在升级后将此 cmdlet 用于共享范围。 不过,您可以将共享范围转换为结果源,这将达到相同的效果。 同样,将 SharePoint Server 网站集升级到 SharePoint Server 后,可以查看本地范围,但不能创建、更新或删除它们。 因此,在升级网站集后,无法将此 cmdlet 用于本地范围。 不过,您可以将本地范围转换为结果源,这将达到相同的效果。

Remove-SPEnterpriseSearchQueryScopeRule cmdlet 从范围规则集合中删除一个或多个共享范围规则。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 https://go.microsoft.com/fwlink/p/?LinkId=251831 上的联机文档。

示例

------------------示例------------------

$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "MySSA"
$scope = Get-SPEnterpriseSearchQueryScope -Identity MustCrawl -SearchApplication $ssa
Get-SPEnterpriseSearchQueryScopeRule -Scope $scope -Url https://criticalSite | Remove-SPEnterpriseSearchQueryScopeRule -Url https://criticalSite

本示例从名为 MySSA 的搜索服务应用程序中删除 URL https://criticalSite 的范围规则。

参数

-Confirm

执行命令前,看到确认提示。 有关详细信息,请键入以下命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要删除的范围规则。

键入的值必须为 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID;有效的范围规则名称(如 ScopeRule1);或有效 ScopeRule 对象的实例。

Type:ScopeRulePipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-SearchApplication

指定包含查询范围规则集合的搜索应用程序。

键入的值必须是 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID;有效的搜索应用程序名称(如 SearchApp1);或有效 SearchServiceApplication 对象的实例。

Type:SearchServiceApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Url

用于为指定的结果 URL 删除查询范围规则的筛选器。

键入的值必须为有效的 URL,格式为 https://server_name。

Type:Uri
Aliases:u
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-范围

用于为指定范围删除多条规则的筛选器。

键入的值必须是标识范围的有效字符串;例如,Scope1。

Type:ScopePipeBind
Aliases:n
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition