Google Cloud Retail V2 Client - Class Rule (1.3.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

Namespace

Google \ Cloud \ Retail \ V2

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ 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
↳ 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.

Returns
Type
Description

hasBoostAction

setBoostAction

A boost action.

Parameter
Name
Description
Returns
Type
Description
$this

getRedirectAction

Redirects a shopper to a specific page.

Returns
Type
Description

hasRedirectAction

setRedirectAction

Redirects a shopper to a specific page.

Parameter
Name
Description
Returns
Type
Description
$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.

Returns
Type
Description

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.

Parameter
Name
Description
Returns
Type
Description
$this

getDoNotAssociateAction

Prevents term from being associated with other terms.

Returns
Type
Description

hasDoNotAssociateAction

setDoNotAssociateAction

Prevents term from being associated with other terms.

Parameter
Name
Description
Returns
Type
Description
$this

getReplacementAction

Replaces specific terms in the query.

Returns
Type
Description

hasReplacementAction

setReplacementAction

Replaces specific terms in the query.

Parameter
Name
Description
Returns
Type
Description
$this

getIgnoreAction

Ignores specific terms from query during search.

Returns
Type
Description

hasIgnoreAction

setIgnoreAction

Ignores specific terms from query during search.

Parameter
Name
Description
Returns
Type
Description
$this

getFilterAction

Filters results.

Returns
Type
Description

hasFilterAction

setFilterAction

Filters results.

Parameter
Name
Description
Returns
Type
Description
$this

getTwowaySynonymsAction

Treats a set of terms as synonyms of one another.

Returns
Type
Description

hasTwowaySynonymsAction

setTwowaySynonymsAction

Treats a set of terms as synonyms of one another.

Parameter
Name
Description
Returns
Type
Description
$this

getCondition

Required. The condition that triggers the rule.

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

Returns
Type
Description

hasCondition

clearCondition

setCondition

Required. The condition that triggers the rule.

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

Parameter
Name
Description
Returns
Type
Description
$this

getAction

Returns
Type
Description
string
Design a Mobile Site
View Site in Mobile | Classic
Share by: