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 \ V2Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ boost_action
↳ redirect_action
↳ oneway_synonyms_action
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
↳ replacement_action
↳ ignore_action
↳ filter_action
↳ twoway_synonyms_action
↳ force_return_facet_action
↳ remove_facet_action
↳ pin_action
↳ condition
Condition
Required. The condition that triggers the rule. If the condition is empty, the rule will always apply.
getBoostAction
A boost action.
hasBoostAction
setBoostAction
A boost action.
$this
getRedirectAction
Redirects a shopper to a specific page.
hasRedirectAction
setRedirectAction
Redirects a shopper to a specific page.
$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.
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.
$this
getDoNotAssociateAction
Prevents term from being associated with other terms.
hasDoNotAssociateAction
setDoNotAssociateAction
Prevents term from being associated with other terms.
$this
getReplacementAction
Replaces specific terms in the query.
hasReplacementAction
setReplacementAction
Replaces specific terms in the query.
$this
getIgnoreAction
Ignores specific terms from query during search.
hasIgnoreAction
setIgnoreAction
Ignores specific terms from query during search.
$this
getFilterAction
Filters results.
hasFilterAction
setFilterAction
Filters results.
$this
getTwowaySynonymsAction
Treats a set of terms as synonyms of one another.
hasTwowaySynonymsAction
setTwowaySynonymsAction
Treats a set of terms as synonyms of one another.
$this
getForceReturnFacetAction
Force returns an attribute as a facet in the request.
hasForceReturnFacetAction
setForceReturnFacetAction
Force returns an attribute as a facet in the request.
$this
getRemoveFacetAction
Remove an attribute as a facet in the request (if present).
hasRemoveFacetAction
setRemoveFacetAction
Remove an attribute as a facet in the request (if present).
$this
getPinAction
Pins one or more specified products to a specific position in the results.
hasPinAction
setPinAction
Pins one or more specified products to a specific position in the results.
$this
getCondition
Required. The condition that triggers the rule.
If the condition is empty, the rule will always apply.
hasCondition
clearCondition
setCondition
Required. The condition that triggers the rule.
If the condition is empty, the rule will always apply.
$this
getAction
string