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”);