Google Cloud Retail V2 Client - Class FacetConfig (1.7.0)

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<Google\Cloud\Retail\V2\Interval>

If you don't set the facet SearchRequest.FacetSpec.FacetKey.intervals 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 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<Google\Cloud\Retail\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 is 25.

↳ merged_facet_values array<Google\Cloud\Retail\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 is 100. This feature is available only for textual custom attributes.

↳ merged_facet Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\MergedFacet

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

↳ rerank_config Google\Cloud\Retail\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 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 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
Google\Protobuf\Internal\RepeatedField

setFacetIntervals

If you don't set the facet SearchRequest.FacetSpec.FacetKey.intervals 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 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<Google\Cloud\Retail\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 is 25.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

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 is 25.

Parameter
Name Description
var array<Google\Cloud\Retail\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 is 100. This feature is available only for textual custom attributes.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

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 is 100. This feature is available only for textual custom attributes.

Parameter
Name Description
var array<Google\Cloud\Retail\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
Google\Cloud\Retail\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 Google\Cloud\Retail\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
Google\Cloud\Retail\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 Google\Cloud\Retail\V2\CatalogAttribute\FacetConfig\RerankConfig
Returns
Type Description
$this