Retail V2 API - Class Google::Cloud::Retail::V2::Rule (v2.6.1)

Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::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 .

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#boost_action

defboost_action()->::Google::Cloud::Retail::V2::Rule::BoostAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::BoostAction) — A boost action.

    Note: The following fields are mutually exclusive: boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#boost_action=

defboost_action=(value)->::Google::Cloud::Retail::V2::Rule::BoostAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::BoostAction) — A boost action.

    Note: The following fields are mutually exclusive: boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::BoostAction) — A boost action.

    Note: The following fields are mutually exclusive: boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#condition

defcondition()->::Google::Cloud::Retail::V2::Condition
Returns

#condition=

defcondition=(value)->::Google::Cloud::Retail::V2::Condition
Parameter
Returns

#do_not_associate_action

defdo_not_associate_action()->::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction) — Prevents term from being associated with other terms.

    Note: The following fields are mutually exclusive: do_not_associate_action, boost_action, redirect_action, oneway_synonyms_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#do_not_associate_action=

defdo_not_associate_action=(value)->::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction) — Prevents term from being associated with other terms.

    Note: The following fields are mutually exclusive: do_not_associate_action, boost_action, redirect_action, oneway_synonyms_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::DoNotAssociateAction) — Prevents term from being associated with other terms.

    Note: The following fields are mutually exclusive: do_not_associate_action, boost_action, redirect_action, oneway_synonyms_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#filter_action

deffilter_action()->::Google::Cloud::Retail::V2::Rule::FilterAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::FilterAction) — Filters results.

    Note: The following fields are mutually exclusive: filter_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#filter_action=

deffilter_action=(value)->::Google::Cloud::Retail::V2::Rule::FilterAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::FilterAction) — Filters results.

    Note: The following fields are mutually exclusive: filter_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::FilterAction) — Filters results.

    Note: The following fields are mutually exclusive: filter_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#force_return_facet_action

defforce_return_facet_action()->::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction) — Force returns an attribute as a facet in the request.

    Note: The following fields are mutually exclusive: force_return_facet_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#force_return_facet_action=

defforce_return_facet_action=(value)->::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction) — Force returns an attribute as a facet in the request.

    Note: The following fields are mutually exclusive: force_return_facet_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction) — Force returns an attribute as a facet in the request.

    Note: The following fields are mutually exclusive: force_return_facet_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#ignore_action

defignore_action()->::Google::Cloud::Retail::V2::Rule::IgnoreAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::IgnoreAction) — Ignores specific terms from query during search.

    Note: The following fields are mutually exclusive: ignore_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#ignore_action=

defignore_action=(value)->::Google::Cloud::Retail::V2::Rule::IgnoreAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::IgnoreAction) — Ignores specific terms from query during search.

    Note: The following fields are mutually exclusive: ignore_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::IgnoreAction) — Ignores specific terms from query during search.

    Note: The following fields are mutually exclusive: ignore_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#oneway_synonyms_action

defoneway_synonyms_action()->::Google::Cloud::Retail::V2::Rule::OnewaySynonymsAction
Returns
  • (::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.

    Note: The following fields are mutually exclusive: oneway_synonyms_action, boost_action, redirect_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#oneway_synonyms_action=

defoneway_synonyms_action=(value)->::Google::Cloud::Retail::V2::Rule::OnewaySynonymsAction
Parameter
  • value (::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.

    Note: The following fields are mutually exclusive: oneway_synonyms_action, boost_action, redirect_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::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.

    Note: The following fields are mutually exclusive: oneway_synonyms_action, boost_action, redirect_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#pin_action

defpin_action()->::Google::Cloud::Retail::V2::Rule::PinAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::PinAction) — Pins one or more specified products to a specific position in the results.

    Note: The following fields are mutually exclusive: pin_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#pin_action=

defpin_action=(value)->::Google::Cloud::Retail::V2::Rule::PinAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::PinAction) — Pins one or more specified products to a specific position in the results.

    Note: The following fields are mutually exclusive: pin_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::PinAction) — Pins one or more specified products to a specific position in the results.

    Note: The following fields are mutually exclusive: pin_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#redirect_action

defredirect_action()->::Google::Cloud::Retail::V2::Rule::RedirectAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::RedirectAction) — Redirects a shopper to a specific page.

    Note: The following fields are mutually exclusive: redirect_action, boost_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#redirect_action=

defredirect_action=(value)->::Google::Cloud::Retail::V2::Rule::RedirectAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::RedirectAction) — Redirects a shopper to a specific page.

    Note: The following fields are mutually exclusive: redirect_action, boost_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::RedirectAction) — Redirects a shopper to a specific page.

    Note: The following fields are mutually exclusive: redirect_action, boost_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#remove_facet_action

defremove_facet_action()->::Google::Cloud::Retail::V2::Rule::RemoveFacetAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::RemoveFacetAction) — Remove an attribute as a facet in the request (if present).

    Note: The following fields are mutually exclusive: remove_facet_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#remove_facet_action=

defremove_facet_action=(value)->::Google::Cloud::Retail::V2::Rule::RemoveFacetAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::RemoveFacetAction) — Remove an attribute as a facet in the request (if present).

    Note: The following fields are mutually exclusive: remove_facet_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::RemoveFacetAction) — Remove an attribute as a facet in the request (if present).

    Note: The following fields are mutually exclusive: remove_facet_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#replacement_action

defreplacement_action()->::Google::Cloud::Retail::V2::Rule::ReplacementAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::ReplacementAction) — Replaces specific terms in the query.

    Note: The following fields are mutually exclusive: replacement_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#replacement_action=

defreplacement_action=(value)->::Google::Cloud::Retail::V2::Rule::ReplacementAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::ReplacementAction) — Replaces specific terms in the query.

    Note: The following fields are mutually exclusive: replacement_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::ReplacementAction) — Replaces specific terms in the query.

    Note: The following fields are mutually exclusive: replacement_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, ignore_action, filter_action, twoway_synonyms_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#twoway_synonyms_action

deftwoway_synonyms_action()->::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction
Returns
  • (::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction) — Treats a set of terms as synonyms of one another.

    Note: The following fields are mutually exclusive: twoway_synonyms_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

#twoway_synonyms_action=

deftwoway_synonyms_action=(value)->::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction
Parameter
  • value (::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction) — Treats a set of terms as synonyms of one another.

    Note: The following fields are mutually exclusive: twoway_synonyms_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns
  • (::Google::Cloud::Retail::V2::Rule::TwowaySynonymsAction) — Treats a set of terms as synonyms of one another.

    Note: The following fields are mutually exclusive: twoway_synonyms_action, boost_action, redirect_action, oneway_synonyms_action, do_not_associate_action, replacement_action, ignore_action, filter_action, force_return_facet_action, remove_facet_action, pin_action. If a field in that set is populated, all other fields in the set will automatically be cleared.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.