Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRule
- Inherits:
-
Object
- Object
- Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRule
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/retail_v2alpha/classes.rb,
lib/google/apis/retail_v2alpha/representations.rb,
lib/google/apis/retail_v2alpha/representations.rb
Overview
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.
Instance Attribute Summary collapse
-
#boost_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleBoostAction
A boost action to apply to results matching condition specified above.
-
#condition ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCondition
Metadata that is used to define a condition that triggers an action.
-
#do_not_associate_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleDoNotAssociateAction
Prevents
query_termfrom being associated with specified terms during search. -
#filter_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleFilterAction
- Rule Condition: - No Condition.query_terms provided is a global match.
-
#ignore_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleIgnoreAction
Prevents a term in the query from being used in search.
-
#oneway_synonyms_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleOnewaySynonymsAction
Maps a set of terms to a set of synonyms.
-
#redirect_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleRedirectAction
Redirects a shopper to a specific page.
-
#replacement_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleReplacementAction
Replaces a term in the query.
-
#twoway_synonyms_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleTwowaySynonymsAction
Creates a set of terms that will be treated as synonyms of each other.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRetailV2alphaRule
constructor
A new instance of GoogleCloudRetailV2alphaRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRetailV2alphaRule
Returns a new instance of GoogleCloudRetailV2alphaRule.
5003 5004 5005 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 5003 def initialize(**args) update!(**args) end |
Instance Attribute Details
#boost_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleBoostAction
A boost action to apply to results matching condition specified above.
Corresponds to the JSON property boostAction
4939 4940 4941 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4939 def boost_action @boost_action end |
#condition ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCondition
Metadata that is used to define a condition that triggers an action. A valid
condition must specify at least one of 'query_terms' or 'products_filter'. If
multiple fields are specified, the condition is met if all the fields are
satisfied e.g. if a set of query terms and product_filter are set, then only
items matching the product_filter for requests with a query matching the query
terms wil get boosted.
Corresponds to the JSON property condition
4949 4950 4951 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4949 def condition @condition end |
#do_not_associate_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleDoNotAssociateAction
Prevents query_term from being associated with specified terms during search.
Example: Don't associate "gShoe" and "cheap".
Corresponds to the JSON property doNotAssociateAction
4955 4956 4957 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4955 def do_not_associate_action @do_not_associate_action end |
#filter_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleFilterAction
- Rule Condition: - No Condition.query_terms provided is a global match. - 1
or more Condition.query_terms provided are combined with OR operator. * Action
Input: The request query and filter that are applied to the retrieved products,
in addition to any filters already provided with the SearchRequest. The AND
operator is used to combine the query's existing filters with the filter rule(
s). NOTE: May result in 0 results when filters conflict. * Action Result:
Filters the returned objects to be ONLY those that passed the filter.
Corresponds to the JSON property
filterAction
4966 4967 4968 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4966 def filter_action @filter_action end |
#ignore_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleIgnoreAction
Prevents a term in the query from being used in search. Example: Don't search
for "shoddy".
Corresponds to the JSON property ignoreAction
4972 4973 4974 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4972 def ignore_action @ignore_action end |
#oneway_synonyms_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleOnewaySynonymsAction
Maps a set of terms to a set of synonyms. Set of synonyms will be treated as
synonyms of each query term only. query_terms will not be treated as
synonyms of each other. Example: "sneakers" will use a synonym of "shoes". "
shoes" will not use a synonym of "sneakers".
Corresponds to the JSON property onewaySynonymsAction
4980 4981 4982 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4980 def oneway_synonyms_action @oneway_synonyms_action end |
#redirect_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleRedirectAction
Redirects a shopper to a specific page. * Rule Condition: - Must specify
Condition.query_terms. * Action Input: Request Query * Action Result:
Redirects shopper to provided uri.
Corresponds to the JSON property redirectAction
4987 4988 4989 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4987 def redirect_action @redirect_action end |
#replacement_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleReplacementAction
Replaces a term in the query. Multiple replacement candidates can be specified.
All query_terms will be replaced with the replacement term. Example:
Replace "gShoe" with "google shoe".
Corresponds to the JSON property replacementAction
4994 4995 4996 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 4994 def replacement_action @replacement_action end |
#twoway_synonyms_action ⇒ Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleTwowaySynonymsAction
Creates a set of terms that will be treated as synonyms of each other. Example:
synonyms of "sneakers" and "shoes": * "sneakers" will use a synonym of "shoes"
. * "shoes" will use a synonym of "sneakers".
Corresponds to the JSON property twowaySynonymsAction
5001 5002 5003 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 5001 def twoway_synonyms_action @twoway_synonyms_action end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 |
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 5008 def update!(**args) @boost_action = args[:boost_action] if args.key?(:boost_action) @condition = args[:condition] if args.key?(:condition) @do_not_associate_action = args[:do_not_associate_action] if args.key?(:do_not_associate_action) @filter_action = args[:filter_action] if args.key?(:filter_action) @ignore_action = args[:ignore_action] if args.key?(:ignore_action) @oneway_synonyms_action = args[:oneway_synonyms_action] if args.key?(:oneway_synonyms_action) @redirect_action = args[:redirect_action] if args.key?(:redirect_action) @replacement_action = args[:replacement_action] if args.key?(:replacement_action) @twoway_synonyms_action = args[:twoway_synonyms_action] if args.key?(:twoway_synonyms_action) end |