Thursday, May 17, 2012

Fix “Property does not exist” error when add search scope rule in Sharepoint

If you configure search scope based on some managed property (e.f. ContentType) via PowerShell using New-SPEnterpriseSearchQueryScopeRule cmdlet, e.g. using the following code:

   1: New-SPEnterpriseSearchQueryScopeRule -Scope $scope -RuleType $ruleType -FilterBehavior
   2: $filterBehavior -ManagedProperty $parameter -PropertyValue $value -Url
   3: $url -SearchApplication $searchApplication -Confirm:$false

You may get the following error:

Property "ContentType" does not exist

In order to fix it go to Central Administration > Service applications > Search service application > Metadata properties > Edit "Content type" property (or property which you use) > Check checkbox "Allow this property to be used in scopes":


After this New-SPEnterpriseSearchQueryScopeRule cmdlet should work successfully.

No comments:

Post a Comment