Skip to main content
  • Type: list<string>
  • Default: []
  • Scope: search
The ruleContexts parameter lets you specify which contextual rules to activate for a given search query. A rule context is a string that acts as a trigger for rules with the same context string. Contexts define the conditions under which a rule applies. For an example, see Customize search results by platform.

Usage

  • Contexts must contain only alphanumeric characters, hyphens, or underscores.
  • If ruleContexts is empty, only non-contextual rules are considered.
  • You can pass up to 10 contexts in a single query.

Example

Current API clients

index.Search(new Query("")
{
    RuleContexts = new List { "front_end", "website2" }
});
index.Search(new Query("")
{
    RuleContexts = new List { "front_end", "website2" }
});
I