# Google Cloud Retail V2 Client - Class ForceReturnFacetAction (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class 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/php/docs/reference/cloud-retail/latest/V2.Condition#_Google_Cloud_Retail_V2_Condition__getQueryTerms__) (for search only) or [Condition.page_categories](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Condition#_Google_Cloud_Retail_V2_Condition__getPageCategories__) (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/php/docs/reference/cloud-retail/latest/V2.Condition#_Google_Cloud_Retail_V2_Condition__getQueryTerms__) is "shoes", the [ForceReturnFacetAction.FacetPositionAdjustment.attribute_name](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Rule.ForceReturnFacetAction.FacetPositionAdjustment#_Google_Cloud_Retail_V2_Rule_ForceReturnFacetAction_FacetPositionAdjustment__getAttributeName__) is "size" and the [ForceReturnFacetAction.FacetPositionAdjustment.position](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Rule.ForceReturnFacetAction.FacetPositionAdjustment#_Google_Cloud_Retail_V2_Rule_ForceReturnFacetAction_FacetPositionAdjustment__getPosition__) 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.

Generated from protobuf message `google.cloud.retail.v2.Rule.ForceReturnFacetAction`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ Rule

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ facet_position_adjustments` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Rule.ForceReturnFacetAction.FacetPositionAdjustment>` Each instance corresponds to a force return attribute for the given condition. There can't be more 15 instances here. |

### getFacetPositionAdjustments

Each instance corresponds to a force return attribute for the given
condition. There can't be more 15 instances here.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Rule.ForceReturnFacetAction.FacetPositionAdjustment>` |   |

### setFacetPositionAdjustments

Each instance corresponds to a force return attribute for the given
condition. There can't be more 15 instances here.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Rule.ForceReturnFacetAction.FacetPositionAdjustment>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |