New-SPEnterpriseSearchMetadataMapping

添加托管属性映射。

语法

New-SPEnterpriseSearchMetadataMapping
   -CrawledProperty <CrawledPropertyPipeBind>
   -ManagedProperty <ManagedPropertyPipeBind>
   -SearchApplication <SearchServiceApplicationPipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-SiteCollection <Guid>]
   [-Tenant <Guid>]
   [-WhatIf]
   [<CommonParameters>]

说明

This cmdlet maps a crawled property to a managed property. SPEnterpriseSearchMetadataMapping represents a snapshot of a mapping between a managed property and one or more crawled properties in the enterprise search metadata property schema.

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

示例

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

$ssa = Get-SPEnterpriseSearchServiceApplication
$mp = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa -Identity UserName
$cat = Get-SPEnterpriseSearchMetadataCategory -SearchApplication $ssa -Identity People
$cp = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -Category $cat -Limit 1
$ncp = New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -Name "MyCrawlProp" -PropSet $cp.PropSet -Category $cp.CategoryName -IsNameEnum $false -VariantType $cp.VariantType -IsMappedToContents $true
New-SPEnterpriseSearchMetadataMapping -SearchApplication $ssa -ManagedProperty $mp -CrawledProperty $ncp

此示例将创建的已爬网属性 MyCrawlProp 映射到默认搜索服务应用程序的托管属性 UserName。

VarientType 参数标记为已过时,但在执行 cmdlet 时仍是必需的 New-SPEnterpriseSearchMetadataCrawledProperty

参数

-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

-CrawledProperty

指定要映射的已爬网属性。

该类型必须是 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID、窗体 https://server_name中的有效 URL 或有效的 CrawledProperty 对象的实例。

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

-ManagedProperty

指定已爬网属性应映射到的托管属性。

键入的值必须是 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID,托管属性的有效名称(例如 ManagedProperty1)或有效 ManagedProperty 对象的实例。

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

-SearchApplication

指定包含元数据映射的搜索应用程序。

键入的值必须是有效的搜索应用程序名称(例如 SearchApp1)或有效 SearchServiceApplication 对象的实例。

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

-SiteCollection

指定返回的元数据映射位于网站集 (SPSite) 范围内。

键入的值必须为用于指定属性集的 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID。

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

-Tenant

指定返回的元数据映射位于租户范围内。

键入的值必须为用于指定属性集的 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID。

Type:Guid
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