How to set Managed property to searchable,queryable,sortable, refinable in SharePoint 2010/2013/2016 using Powershell?

Hello SharePointers,

Here are the powershell script to set Searchable, queryable, Sortable, Retrievable, Refinable for a managed property.

$searchappln = Get-SPEnterpriseSearchServiceApplication
$ManagedProperty = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchappln -Identity $_.ManagedPropertyName -ea silentlycontinue

if($ManagedProperty)
{
$ManagedProperty.Searchable = $true
$ManagedProperty.Queryable = $true
$ManagedProperty.Sortable = $true
$ManagedProperty.Retrievable = $true
$ManagedProperty.Refinable = $true
$ManagedProperty.SafeForAnonymous = $true
$ManagedProperty.update()
write-host “The searchable, queryable, Sortable, Retrievable and Refinable for the managed property” $_.ManagedPropertyName ” has been setup ” -fore green
}

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published.