Retail v2 API - Class Rule (2.4.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
Rule.ActionOneofCase

BoostAction

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

A boost action.

Property Value
TypeDescription
Rule.Types.BoostAction

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
Rule.Types.DoNotAssociateAction

FilterAction

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

Filters results.

Property Value
TypeDescription
Rule.Types.FilterAction

IgnoreAction

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

Ignores specific terms from query during search.

Property Value
TypeDescription
Rule.Types.IgnoreAction

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
Rule.Types.OnewaySynonymsAction

RedirectAction

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

Redirects a shopper to a specific page.

Property Value
TypeDescription
Rule.Types.RedirectAction

ReplacementAction

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

Replaces specific terms in the query.

Property Value
TypeDescription
Rule.Types.ReplacementAction

TwowaySynonymsAction

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

Treats a set of terms as synonyms of one another.

Property Value
TypeDescription
Rule.Types.TwowaySynonymsAction