Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRule
- Inherits:
-
Object
- Object
- Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRule
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/retail_v2beta/classes.rb,
lib/google/apis/retail_v2beta/representations.rb,
lib/google/apis/retail_v2beta/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::RetailV2beta::GoogleCloudRetailV2betaRuleBoostAction
A boost action to apply to results matching condition specified above.
-
#condition ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCondition
Metadata that is used to define a condition that triggers an action.
-
#do_not_associate_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleDoNotAssociateAction
Prevents
query_termfrom being associated with specified terms during search. -
#filter_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleFilterAction
- Rule Condition: - No Condition.query_terms provided is a global match.
-
#force_return_facet_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleForceReturnFacetAction
Force returns an attribute/facet in the request around a certain position or above.
-
#ignore_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleIgnoreAction
Prevents a term in the query from being used in search.
-
#oneway_synonyms_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleOnewaySynonymsAction
Maps a set of terms to a set of synonyms.
-
#pin_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRulePinAction
Pins one or more specified products to a specific position in the results.
-
#redirect_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleRedirectAction
Redirects a shopper to a specific page.
-
#remove_facet_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleRemoveFacetAction
Removes an attribute/facet in the request if is present.
-
#replacement_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleReplacementAction
Replaces a term in the query.
-
#twoway_synonyms_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleTwowaySynonymsAction
Creates a set of terms that will be treated as synonyms of each other.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRetailV2betaRule
constructor
A new instance of GoogleCloudRetailV2betaRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRetailV2betaRule
Returns a new instance of GoogleCloudRetailV2betaRule.
7700 7701 7702 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7700 def initialize(**args) update!(**args) end |
Instance Attribute Details
#boost_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleBoostAction
A boost action to apply to results matching condition specified above.
Corresponds to the JSON property boostAction
7594 7595 7596 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7594 def boost_action @boost_action end |
#condition ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCondition
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
7604 7605 7606 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7604 def condition @condition end |
#do_not_associate_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleDoNotAssociateAction
Prevents query_term from being associated with specified terms during search.
Example: Don't associate "gShoe" and "cheap".
Corresponds to the JSON property doNotAssociateAction
7610 7611 7612 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7610 def do_not_associate_action @do_not_associate_action end |
#filter_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleFilterAction
- 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
7621 7622 7623 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7621 def filter_action @filter_action end |
#force_return_facet_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleForceReturnFacetAction
Force returns an attribute/facet in the request around a certain position or
above. * Rule Condition: Must specify non-empty Condition.query_terms (for
search only) or Condition.page_categories (for browse only), but can't specify
both. * Action Inputs: attribute name, position * Action Result: Will force
return a facet key around a certain position or above if the condition is
satisfied. Example: Suppose the query is "shoes", the Condition.query_terms is
"shoes", the ForceReturnFacetAction.FacetPositionAdjustment.attribute_name is "
size" and the ForceReturnFacetAction.FacetPositionAdjustment.position is 8.
Two cases: a) The facet key "size" is not already in the top 8 slots, then the
facet "size" will appear at a position close to 8. b) The facet key "size" in
among the top 8 positions in the request, then it will stay at its current
rank.
Corresponds to the JSON property forceReturnFacetAction
7637 7638 7639 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7637 def force_return_facet_action @force_return_facet_action end |
#ignore_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleIgnoreAction
Prevents a term in the query from being used in search. Example: Don't search
for "shoddy".
Corresponds to the JSON property ignoreAction
7643 7644 7645 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7643 def ignore_action @ignore_action end |
#oneway_synonyms_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleOnewaySynonymsAction
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
7651 7652 7653 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7651 def oneway_synonyms_action @oneway_synonyms_action end |
#pin_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRulePinAction
Pins one or more specified products to a specific position in the results. *
Rule Condition: Must specify non-empty Condition.query_terms (for search only)
or Condition.page_categories (for browse only), but can't specify both. *
Action Input: mapping of [pin_position, product_id] pairs (pin position uses
1-based indexing). * Action Result: Will pin products with matching ids to the
position specified in the final result order. Example: Suppose the query is
shoes, the Condition.query_terms is shoes and the pin_map has 1, "pid1",
then product with pid1 will be pinned to the top position in the final
results. If multiple PinActions are matched to a single request the actions
will be processed from most to least recently updated. Pins to positions
larger than the max allowed page size of 120 are not allowed.
Corresponds to the JSON property pinAction
7666 7667 7668 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7666 def pin_action @pin_action end |
#redirect_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleRedirectAction
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
7673 7674 7675 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7673 def redirect_action @redirect_action end |
#remove_facet_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleRemoveFacetAction
Removes an attribute/facet in the request if is present. * Rule Condition:
Must specify non-empty Condition.query_terms (for search only) or Condition.
page_categories (for browse only), but can't specify both. * Action Input:
attribute name * Action Result: Will remove the attribute (as a facet) from
the request if it is present. Example: Suppose the query is "shoes", the
Condition.query_terms is "shoes" and the attribute name "size", then facet key
"size" will be removed from the request (if it is present).
Corresponds to the JSON property removeFacetAction
7684 7685 7686 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7684 def remove_facet_action @remove_facet_action end |
#replacement_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleReplacementAction
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
7691 7692 7693 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7691 def replacement_action @replacement_action end |
#twoway_synonyms_action ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRuleTwowaySynonymsAction
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
7698 7699 7700 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7698 def twoway_synonyms_action @twoway_synonyms_action end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 7705 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) @force_return_facet_action = args[:force_return_facet_action] if args.key?(:force_return_facet_action) @ignore_action = args[:ignore_action] if args.key?(:ignore_action) @oneway_synonyms_action = args[:oneway_synonyms_action] if args.key?(:oneway_synonyms_action) @pin_action = args[:pin_action] if args.key?(:pin_action) @redirect_action = args[:redirect_action] if args.key?(:redirect_action) @remove_facet_action = args[:remove_facet_action] if args.key?(:remove_facet_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 |