Google Cloud Retail V2 Client - Class Rule (1.0.1)

Reference documentation and code samples for the Google Cloud Retail V2 Client 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 with SOLUTION_TYPE_SEARCH.

Generated from protobuf message google.cloud.retail.v2.Rule

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ boost_action Google\Cloud\Retail\V2\Rule\BoostAction

A boost action.

↳ redirect_action Google\Cloud\Retail\V2\Rule\RedirectAction

Redirects a shopper to a specific page.

↳ oneway_synonyms_action Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction

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

↳ do_not_associate_action Google\Cloud\Retail\V2\Rule\DoNotAssociateAction

Prevents term from being associated with other terms.

↳ replacement_action Google\Cloud\Retail\V2\Rule\ReplacementAction

Replaces specific terms in the query.

↳ ignore_action Google\Cloud\Retail\V2\Rule\IgnoreAction

Ignores specific terms from query during search.

↳ filter_action Google\Cloud\Retail\V2\Rule\FilterAction

Filters results.

↳ twoway_synonyms_action Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction

Treats a set of terms as synonyms of one another.

↳ condition Google\Cloud\Retail\V2\Condition

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

getBoostAction

A boost action.

Generated from protobuf field .google.cloud.retail.v2.Rule.BoostAction boost_action = 2;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\BoostAction|null

hasBoostAction

setBoostAction

A boost action.

Generated from protobuf field .google.cloud.retail.v2.Rule.BoostAction boost_action = 2;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\BoostAction
Returns
TypeDescription
$this

getRedirectAction

Redirects a shopper to a specific page.

Generated from protobuf field .google.cloud.retail.v2.Rule.RedirectAction redirect_action = 3;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\RedirectAction|null

hasRedirectAction

setRedirectAction

Redirects a shopper to a specific page.

Generated from protobuf field .google.cloud.retail.v2.Rule.RedirectAction redirect_action = 3;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\RedirectAction
Returns
TypeDescription
$this

getOnewaySynonymsAction

Treats specific term as a synonym with a group of terms.

Group of terms will not be treated as synonyms with the specific term.

Generated from protobuf field .google.cloud.retail.v2.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction|null

hasOnewaySynonymsAction

setOnewaySynonymsAction

Treats specific term as a synonym with a group of terms.

Group of terms will not be treated as synonyms with the specific term.

Generated from protobuf field .google.cloud.retail.v2.Rule.OnewaySynonymsAction oneway_synonyms_action = 6;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\OnewaySynonymsAction
Returns
TypeDescription
$this

getDoNotAssociateAction

Prevents term from being associated with other terms.

Generated from protobuf field .google.cloud.retail.v2.Rule.DoNotAssociateAction do_not_associate_action = 7;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\DoNotAssociateAction|null

hasDoNotAssociateAction

setDoNotAssociateAction

Prevents term from being associated with other terms.

Generated from protobuf field .google.cloud.retail.v2.Rule.DoNotAssociateAction do_not_associate_action = 7;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\DoNotAssociateAction
Returns
TypeDescription
$this

getReplacementAction

Replaces specific terms in the query.

Generated from protobuf field .google.cloud.retail.v2.Rule.ReplacementAction replacement_action = 8;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\ReplacementAction|null

hasReplacementAction

setReplacementAction

Replaces specific terms in the query.

Generated from protobuf field .google.cloud.retail.v2.Rule.ReplacementAction replacement_action = 8;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\ReplacementAction
Returns
TypeDescription
$this

getIgnoreAction

Ignores specific terms from query during search.

Generated from protobuf field .google.cloud.retail.v2.Rule.IgnoreAction ignore_action = 9;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\IgnoreAction|null

hasIgnoreAction

setIgnoreAction

Ignores specific terms from query during search.

Generated from protobuf field .google.cloud.retail.v2.Rule.IgnoreAction ignore_action = 9;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\IgnoreAction
Returns
TypeDescription
$this

getFilterAction

Filters results.

Generated from protobuf field .google.cloud.retail.v2.Rule.FilterAction filter_action = 10;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\FilterAction|null

hasFilterAction

setFilterAction

Filters results.

Generated from protobuf field .google.cloud.retail.v2.Rule.FilterAction filter_action = 10;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\FilterAction
Returns
TypeDescription
$this

getTwowaySynonymsAction

Treats a set of terms as synonyms of one another.

Generated from protobuf field .google.cloud.retail.v2.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;

Returns
TypeDescription
Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction|null

hasTwowaySynonymsAction

setTwowaySynonymsAction

Treats a set of terms as synonyms of one another.

Generated from protobuf field .google.cloud.retail.v2.Rule.TwowaySynonymsAction twoway_synonyms_action = 11;

Parameter
NameDescription
var Google\Cloud\Retail\V2\Rule\TwowaySynonymsAction
Returns
TypeDescription
$this

getCondition

Required. The condition that triggers the rule.

If the condition is empty, the rule will always apply.

Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Google\Cloud\Retail\V2\Condition|null

hasCondition

clearCondition

setCondition

Required. The condition that triggers the rule.

If the condition is empty, the rule will always apply.

Generated from protobuf field .google.cloud.retail.v2.Condition condition = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
var Google\Cloud\Retail\V2\Condition
Returns
TypeDescription
$this

getAction

Returns
TypeDescription
string