# Retail V2 API - Class Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction (v2.9.0)

2.9.0 (latest) 2.8.1 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.3.0 1.2.0 1.1.0 1.0.1 0.21.0 0.20.0 0.19.0 0.18.2 0.17.0 0.16.1 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.4 Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction.

Force returns an attribute/facet in the request around a certain position
or above.


- Rule Condition:
  Must specify non-empty
  [Condition.query_terms](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Condition#Google__Cloud__Retail__V2__Condition_query_terms_instance_ "Google::Cloud::Retail::V2::Condition#query_terms (method)")
  (for search only) or
  [Condition.page_categories](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Condition#Google__Cloud__Retail__V2__Condition_page_categories_instance_ "Google::Cloud::Retail::V2::Condition#page_categories (method)")
  (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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Condition#Google__Cloud__Retail__V2__Condition_query_terms_instance_ "Google::Cloud::Retail::V2::Condition#query_terms (method)") is
"shoes", the
[ForceReturnFacetAction.FacetPositionAdjustment.attribute_name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule-ForceReturnFacetAction-FacetPositionAdjustment#Google__Cloud__Retail__V2__Rule__ForceReturnFacetAction__FacetPositionAdjustment_attribute_name_instance_ "Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment#attribute_name (method)")
is "size" and the
[ForceReturnFacetAction.FacetPositionAdjustment.position](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule-ForceReturnFacetAction-FacetPositionAdjustment#Google__Cloud__Retail__V2__Rule__ForceReturnFacetAction__FacetPositionAdjustment_position_instance_ "Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment#position (method)")
is 8.

<br />

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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #facet_position_adjustments

    def facet_position_adjustments() -> ::Array<::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment>

**Returns**

- (::Array\<[::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule-ForceReturnFacetAction-FacetPositionAdjustment)\>) --- Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.

### #facet_position_adjustments=

    def facet_position_adjustments=(value) -> ::Array<::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule-ForceReturnFacetAction-FacetPositionAdjustment)\>) --- Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.
**Returns**

- (::Array\<[::Google::Cloud::Retail::V2::Rule::ForceReturnFacetAction::FacetPositionAdjustment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Rule-ForceReturnFacetAction-FacetPositionAdjustment)\>) --- Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here.