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

Possible options for the facet that corresponds to the current attribute
config.

Generated from protobuf message `google.cloud.retail.v2.CatalogAttribute.FacetConfig`

## Namespace

Google \\ Cloud \\ Retail \\ V2 \\ CatalogAttribute

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ facet_intervals` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Interval>` If you don't set the facet [SearchRequest.FacetSpec.FacetKey.intervals](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.FacetSpec.FacetKey#_Google_Cloud_Retail_V2_SearchRequest_FacetSpec_FacetKey__getIntervals__) in the request to a numerical attribute, then we use the computed intervals with rounded bounds obtained from all its product numerical attribute values. The computed intervals might not be ideal for some attributes. Therefore, we give you the option to overwrite them with the facet_intervals field. The maximum of facet intervals per [CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 40. Each interval must have a lower bound or an upper bound. If both bounds are provided, then the lower bound must be smaller or equal than the upper bound. |
| `↳ ignored_facet_values` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.IgnoredFacetValues>` Each instance represents a list of attribute values to ignore as facet values for a specific time range. The maximum number of instances per [CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 25. |
| `↳ merged_facet_values` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.MergedFacetValue>` Each instance replaces a list of facet values by a merged facet value. If a facet value is not in any list, then it will stay the same. To avoid conflicts, only paths of length 1 are accepted. In other words, if "dark_blue" merged into "BLUE", then the latter can't merge into "blues" because this would create a path of length 2. The maximum number of instances of MergedFacetValue per [CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 100. This feature is available only for textual custom attributes. |
| `↳ merged_facet` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.MergedFacet` Use this field only if you want to merge a facet key into another facet key. |
| `↳ rerank_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.RerankConfig` Set this field only if you want to rerank based on facet values engaged by the user for the current key. This option is only possible for custom facetable textual keys. |

### getFacetIntervals

If you don't set the facet
[SearchRequest.FacetSpec.FacetKey.intervals](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.FacetSpec.FacetKey#_Google_Cloud_Retail_V2_SearchRequest_FacetSpec_FacetKey__getIntervals__)
in the request to a numerical attribute, then we use the computed
intervals with rounded bounds obtained from all its product numerical
attribute values. The computed intervals might not be ideal for some
attributes. Therefore, we give you the option to overwrite them with the
facet_intervals field. The maximum of facet intervals per
[CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 40. Each
interval must have a lower bound or an upper bound. If both bounds are
provided, then the lower bound must be smaller or equal than the upper
bound.

| **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.Interval>` |   |

### setFacetIntervals

If you don't set the facet
[SearchRequest.FacetSpec.FacetKey.intervals](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.SearchRequest.FacetSpec.FacetKey#_Google_Cloud_Retail_V2_SearchRequest_FacetSpec_FacetKey__getIntervals__)
in the request to a numerical attribute, then we use the computed
intervals with rounded bounds obtained from all its product numerical
attribute values. The computed intervals might not be ideal for some
attributes. Therefore, we give you the option to overwrite them with the
facet_intervals field. The maximum of facet intervals per
[CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 40. Each
interval must have a lower bound or an upper bound. If both bounds are
provided, then the lower bound must be smaller or equal than the upper
bound.

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

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

### getIgnoredFacetValues

Each instance represents a list of attribute values to ignore as facet
values for a specific time range. The maximum number of instances per
[CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 25.

| **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.CatalogAttribute.FacetConfig.IgnoredFacetValues>` |   |

### setIgnoredFacetValues

Each instance represents a list of attribute values to ignore as facet
values for a specific time range. The maximum number of instances per
[CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 25.

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

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

### getMergedFacetValues

Each instance replaces a list of facet values by a merged facet
value. If a facet value is not in any list, then it will stay the same.

To avoid conflicts, only paths of length 1 are accepted. In other words,
if "dark_blue" merged into "BLUE", then the latter can't merge into
"blues" because this would create a path of length 2. The maximum number
of instances of MergedFacetValue per
[CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 100. This
feature is available only for textual custom attributes.

| **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.CatalogAttribute.FacetConfig.MergedFacetValue>` |   |

### setMergedFacetValues

Each instance replaces a list of facet values by a merged facet
value. If a facet value is not in any list, then it will stay the same.

To avoid conflicts, only paths of length 1 are accepted. In other words,
if "dark_blue" merged into "BLUE", then the latter can't merge into
"blues" because this would create a path of length 2. The maximum number
of instances of MergedFacetValue per
[CatalogAttribute](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) is 100. This
feature is available only for textual custom attributes.

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

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

### getMergedFacet

Use this field only if you want to merge a facet key into another facet
key.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.MergedFacet|null` |   |

### hasMergedFacet

### clearMergedFacet

### setMergedFacet

Use this field only if you want to merge a facet key into another facet
key.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.MergedFacet` |

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

### getRerankConfig

Set this field only if you want to rerank based on facet values engaged
by the user for the current key. This option is only possible for custom
facetable textual keys.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.RerankConfig|null` |   |

### hasRerankConfig

### clearRerankConfig

### setRerankConfig

Set this field only if you want to rerank based on facet values engaged
by the user for the current key. This option is only possible for custom
facetable textual keys.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute.FacetConfig.RerankConfig` |

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