Scope with content source rule

I’am creating a feature that setups  the search settings for a project. The feature creates some content sources and scopes. I discoverd that there is no method for adding a rule type ‘Content Source’ on the Scope.  The following create rule methods are availble:

  • CreateAllContetRyle
  • CreatePropertyQueryRule
  • CreateUrlRule

I expected a method like ‘CreateContentSourceRule’, like the user interface offers. Using reflector I dissabled the page page and found out that a new Content Source rule is created using the CreatePropertyQueryRule:

scope.Rules.CreatePropertyQueryRule(ScopeRuleFilterBehavior.Invlude, managedProperties.[“ContentSource”], “yourconcentsourcename”);


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s