# Google Cloud Retail V2 Client - Class DynamicFacetSpec (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 DynamicFacetSpec.

The specifications of dynamically generated facets.

Generated from protobuf message `google.cloud.retail.v2.SearchRequest.DynamicFacetSpec`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ SearchRequest

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ mode` | `int` Mode of the DynamicFacet feature. Defaults to [Mode.DISABLED](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.DynamicFacetSpec.Mode#_Google_Cloud_Retail_V2_SearchRequest_DynamicFacetSpec_Mode__DISABLED) if it's unset. |

### getMode

Mode of the DynamicFacet feature.

Defaults to
[Mode.DISABLED](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.DynamicFacetSpec.Mode#_Google_Cloud_Retail_V2_SearchRequest_DynamicFacetSpec_Mode__DISABLED)
if it's unset.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Mode](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.DynamicFacetSpec.Mode). |

### setMode

Mode of the DynamicFacet feature.

Defaults to
[Mode.DISABLED](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.DynamicFacetSpec.Mode#_Google_Cloud_Retail_V2_SearchRequest_DynamicFacetSpec_Mode__DISABLED)
if it's unset.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Mode](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.DynamicFacetSpec.Mode). |

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