Thursday, November 28, 2013

Add a crawled property in SharePoint 2013 with sortable/Refinable using Powershell

Add a crawled property in SharePoint 2013 with sortable/Refinable using Powershell

For Sortable:

New-SPEnterpriseSearchMetadataCrawledProperty -Category SharePoint -IsNameEnum $false -Name "ows_MyCrawledProperty" -PropSet 00130329-0000-0130-c000-000000131346 -SearchApplication "Search Service Application" -VariantType 0
 
New-SPEnterpriseSearchMetadataManagedProperty -Name "MyCrawledProperty" -SearchApplication "Search Service Application" -Type 1 -Queryable $true -Retrievable $true
 
$cp = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication "Search Service Application" "ows_MyCrawledProperty"
 
$mp = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication "Search Service Application" -Identity "MyCrawledProperty"

$mp.sortable= $true

$mp.update
 
New-SPEnterpriseSearchMetadataMapping -SearchApplication "Search Service Application" -CrawledProperty $cp -ManagedProperty $mp


For Refinable:

New-SPEnterpriseSearchMetadataCrawledProperty -Category SharePoint -IsNameEnum $false -Name "ows_MyCrawledProperty" -PropSet 00130329-0000-0130-c000-000000131346 -SearchApplication "Search Service Application" -VariantType 0
 
New-SPEnterpriseSearchMetadataManagedProperty -Name "MyCrawledProperty" -SearchApplication "Search Service Application" -Type 1 -Queryable $true -Retrievable $true
 
$cp = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication "Search Service Application" "ows_MyCrawledProperty"
 
$mp = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication "Search Service Application" -Identity "MyCrawledProperty"

$mp.Refinable= $true

$mp.update
 
New-SPEnterpriseSearchMetadataMapping -SearchApplication "Search Service Application" -CrawledProperty $cp -ManagedProperty $mp

No comments:

Post a Comment

Email sent from a shared mailbox are not saved to the Sent Items

  Issue : When a user sends an Email from his delegated (shared) mailbox the Email which sent from the delegated mailbox are stored in user...