Remove-SPEnterpriseSearchResultItemType

删除搜索对象所有者的结果项类型。

语法

Remove-SPEnterpriseSearchResultItemType
      [-Identity] <ResultItemTypePipeBind>
      -Owner <SearchObjectOwner>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-SearchApplication <SearchServiceApplicationPipeBind>]
      [-SearchApplicationProxy <SearchServiceApplicationProxyPipeBind>]
      [-WhatIf]
      [<CommonParameters>]

说明

如果结果类型标识和搜索所有者,cmdlet Remove-SPEnterpriseSearchResultItemType 将删除用户创建的结果项类型。 不能使用此 cmdlet 删除 SharePoint 产品中包含的内置结果项类型。

通过结果项类型,可以根据结果类型更改搜索结果的外观。 首先定义规则的集合,这些规则将根据结果的属性进行评估。 然后定义用于呈现该类型的结果的显示模板。 创建结果项类型后,匹配结果项类型的规则的结果将使用指定的显示模板显示。

用例示例:

  • 更改特定文件扩展名的结果外观,例如 Word 文档。

  • 更改搜索结果中特定内容类型的外观。

  • 更改特定作者的结果的外观。

  • 将一个结果操作从作为自定义搜索应用程序一部分的特定结果源添加到结果中。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

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

$web = Get-SPWeb "UrlOfTheSite"
$tenantOwner = Get-SPEnterpriseSearchOwner -Level SPSite -SPWeb $web
$searchapp = Get-SPEnterpriseSearchServiceApplication
$resultType = Get-SPEnterpriseSearchResultItemType -Owner $tenantOwner -SearchApplication $searchapp
Remove-SPEnterpriseSearchResultItemType -Identity $resultType -Owner $tenantOwner -SearchApplication $searchapp

本示例首先定义网站 URL、搜索所有者和搜索应用程序的变量。 然后,它将检索结果项类型,并检查结果项类型是否为内置结果项类型。 如果 $resultType.BuiltIn 返回 false,则结果项类型不是内置的,可以对其进行修改。 接下来,该示例删除$tenantOwner引用的所有者$resultType引用的结果项类型。

参数

-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。

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

-Owneer

指定用于定义创建结果项类型的范围的搜索对象所有者。

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

-SearchApplication

Specifies the name of the search application. The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid search application name (for example, SearchApp1); or an instance of a valid SearchServiceApplication object.

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

-SearchApplicationProxy

Specifies the proxy of the search application that contains the result item type. The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid search application proxy name (for example, SearchAppProxy1); or an instance of a valid SearchServiceApplicationProxy object.

Type:SearchServiceApplicationProxyPipeBind
Position:Named
Default value:None
Accept pipeline input:True
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