Retail v2 API - Class Rule (2.7.0)

public sealed class Rule : IMessage<Rule>, IEquatable<Rule>, IDeepCloneable<Rule>, IBufferMessage, IMessage

Reference documentation and code samples for the Retail v2 API class Rule.

A rule is a condition-action pair

  • A condition defines when a rule is to be triggered.
  • An action specifies what occurs on that trigger. Currently rules only work for [controls][google.cloud.retail.v2.Control] with [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2.SolutionType.SOLUTION_TYPE_SEARCH].

Inheritance

object > Rule

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Constructors

Rule()

public Rule()

Rule(Rule)

public Rule(Rule other)
Parameter
NameDescription
otherRule

Properties

ActionCase

public Rule.ActionOneofCase ActionCase { get; }
Property Value
TypeDescription
RuleActionOneofCase

BoostAction

public Rule.Types.BoostAction BoostAction { get; set; }

A boost action.

Property Value
TypeDescription
RuleTypesBoostAction

Condition

public Condition Condition { get; set; }

Required. The condition that triggers the rule. If the condition is empty, the rule will always apply.

Property Value
TypeDescription
Condition

DoNotAssociateAction

public Rule.Types.DoNotAssociateAction DoNotAssociateAction { get; set; }

Prevents term from being associated with other terms.

Property Value
TypeDescription
RuleTypesDoNotAssociateAction

FilterAction

public Rule.Types.FilterAction FilterAction { get; set; }

Filters results.

Property Value
TypeDescription
RuleTypesFilterAction

IgnoreAction

public Rule.Types.IgnoreAction IgnoreAction { get; set; }

Ignores specific terms from query during search.

Property Value
TypeDescription
RuleTypesIgnoreAction

OnewaySynonymsAction

public Rule.Types.OnewaySynonymsAction OnewaySynonymsAction { get; set; }

Treats specific term as a synonym with a group of terms. Group of terms will not be treated as synonyms with the specific term.

Property Value
TypeDescription
RuleTypesOnewaySynonymsAction

RedirectAction

public Rule.Types.RedirectAction RedirectAction { get; set; }

Redirects a shopper to a specific page.

Property Value
TypeDescription
RuleTypesRedirectAction

ReplacementAction

public Rule.Types.ReplacementAction ReplacementAction { get; set; }

Replaces specific terms in the query.

Property Value
TypeDescription
RuleTypesReplacementAction

TwowaySynonymsAction

public Rule.Types.TwowaySynonymsAction TwowaySynonymsAction { get; set; }

Treats a set of terms as synonyms of one another.

Property Value
TypeDescription
RuleTypesTwowaySynonymsAction