Retail v2 API - Class Rule (2.11.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
Name Description
other Rule

Properties

ActionCase

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

BoostAction

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

A boost action.

Property Value
Type Description
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
Type Description
Condition

DoNotAssociateAction

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

Prevents term from being associated with other terms.

Property Value
Type Description
RuleTypesDoNotAssociateAction

FilterAction

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

Filters results.

Property Value
Type Description
RuleTypesFilterAction

ForceReturnFacetAction

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

Force returns an attribute as a facet in the request.

Property Value
Type Description
RuleTypesForceReturnFacetAction

IgnoreAction

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

Ignores specific terms from query during search.

Property Value
Type Description
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
Type Description
RuleTypesOnewaySynonymsAction

RedirectAction

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

Redirects a shopper to a specific page.

Property Value
Type Description
RuleTypesRedirectAction

RemoveFacetAction

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

Remove an attribute as a facet in the request (if present).

Property Value
Type Description
RuleTypesRemoveFacetAction

ReplacementAction

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

Replaces specific terms in the query.

Property Value
Type Description
RuleTypesReplacementAction

TwowaySynonymsAction

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

Treats a set of terms as synonyms of one another.

Property Value
Type Description
RuleTypesTwowaySynonymsAction