Set-SPEnterpriseSearchMetadataMapping
为 Search Service 应用程序设置托管属性映射的属性。
语法
Set-SPEnterpriseSearchMetadataMapping
[-Identity] <MappingPipeBind>
[-SearchApplication <SearchServiceApplicationPipeBind>]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-CrawledProperty <CrawledPropertyPipeBind>]
[-ManagedProperty <ManagedPropertyPipeBind>]
[-SiteCollection <Guid>]
[-Tenant <Guid>]
[-WhatIf]
[<CommonParameters>]
说明
此 cmdlet 可更新托管属性映射的属性。 SPEnterpriseSearchMetadataMapping 表示企业级搜索元数据属性架构中的一个托管属性与一个或多个已爬网属性之间的映射。
有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet。
示例
------------------示例------------------
$ssa = Get-SPEnterpriseSearchServiceApplication
## get the crawl property to set to, in this case a new property is created
$cat = Get-SPEnterpriseSearchMetadataCategory -SearchApplication $ssa -Identity People
$cp = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -Category $cat -Limit 1
$ncp = New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -Name "MyNewCrawlProp" -PropSet $cp.PropSet -Category $cp.CategoryName -IsNameEnum $false -VariantType $cp.VariantType -IsMappedToContents $true
## get the mapping to replace
$mycp = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -Name MyCrawlProp
$map = Get-SPEnterpriseSearchMetadataMapping -SearchApplication $ssa -ManagedProperty $mp -CrawledProperty $mycp
## set the new crawl property to map to for this mapping
Set-SPEnterpriseSearchMetadataMapping -Identity $map -SearchApplication $ssa -CrawledProperty $ncp
此示例更新托管属性 UserName 和已爬网属性 MyCrawlProp 之间的现有映射, (请参阅 New-SPEnterpriseSearchMetadataMapping
默认搜索服务应用程序的) 。
已爬网属性将由名为 MyNewCrawlProp 的新已爬网属性取代。
参数
-AssignmentCollection
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
使用全局参数时,所有对象均包含在全局存储中。
如果未立即使用对象,或未通过使用 Stop-SPAssignment
命令来处理对象,则可能会发生内存不足的情况。
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Confirm
执行命令前,看到确认提示。
有关详细信息,请键入以下命令:get-help about_commonparameters
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-CrawledProperty
指定要映射的已爬网属性。
类型必须是有效的 GUID,格式为 12345678-90ab-cdef-1234-567890bcdefgh、表单 https://server_name中的有效 URL 或有效的 CrawledProperty 对象的实例。
注意:Null 表示该值未更改。
Type: | CrawledPropertyPipeBind |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Identity
指定要更新的元数据映射。
类型必须是有效的 URL,格式 https://server_name为 ,或者是有效 Mapping 对象的实例。
Type: | MappingPipeBind |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ManagedProperty
指定用于接收已爬网属性映射的托管属性。
键入的值必须是 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID,托管属性的有效名称(例如 ManagedProperty1)或有效 ManagedProperty 对象的实例。
注意:Null 表示该值未更改。
Type: | ManagedPropertyPipeBind |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-SearchApplication
指定包含元数据映射的搜索应用程序。
键入的值必须是有效的搜索应用程序名称(例如 SearchApp1)或有效 SearchServiceApplication 对象的实例。
Type: | SearchServiceApplicationPipeBind |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-SiteCollection
指定返回的元数据映射位于网站集 (SPSite) 范围内。
键入的值必须为用于指定属性集的 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Tenant
指定返回的元数据映射位于租户范围内。
键入的值必须为用于指定属性集的 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-WhatIf
显示一条描述命令作用的消息,而不执行命令。
有关详细信息,请键入以下命令:get-help about_commonparameters
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |