Google Cloud Retail V2 Client - Class FacetValue (1.4.2)

Reference documentation and code samples for the Google Cloud Retail V2 Client class FacetValue.

A facet value which contains value names and their count.

Generated from protobuf message google.cloud.retail.v2.SearchResponse.Facet.FacetValue

Namespace

Google \ Cloud \ Retail \ V2 \ SearchResponse \ Facet

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ value string

Text value of a facet, such as "Black" for facet "colorFamilies".

↳ interval Google\Cloud\Retail\V2\Interval

Interval value for a facet, such as 10, 20) for facet "price".

↳ count int|string

Number of items that have this facet value.

↳ min_value float

The minimum value in the [FacetValue.interval. Only supported on numerical facets and returned if SearchRequest.FacetSpec.FacetKey.return_min_max is true.

↳ max_value float

The maximum value in the FacetValue.interval. Only supported on numerical facets and returned if SearchRequest.FacetSpec.FacetKey.return_min_max is true.

getValue

Text value of a facet, such as "Black" for facet "colorFamilies".

Returns
TypeDescription
string

hasValue

setValue

Text value of a facet, such as "Black" for facet "colorFamilies".

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getInterval

Interval value for a facet, such as [10, 20) for facet "price".

Returns
TypeDescription
Google\Cloud\Retail\V2\Interval|null

hasInterval

setInterval

Interval value for a facet, such as [10, 20) for facet "price".

Parameter
NameDescription
var Google\Cloud\Retail\V2\Interval
Returns
TypeDescription
$this

getCount

Number of items that have this facet value.

Returns
TypeDescription
int|string

setCount

Number of items that have this facet value.

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getMinValue

The minimum value in the FacetValue.interval.

Only supported on numerical facets and returned if SearchRequest.FacetSpec.FacetKey.return_min_max is true.

Returns
TypeDescription
float

setMinValue

The minimum value in the FacetValue.interval.

Only supported on numerical facets and returned if SearchRequest.FacetSpec.FacetKey.return_min_max is true.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getMaxValue

The maximum value in the FacetValue.interval.

Only supported on numerical facets and returned if SearchRequest.FacetSpec.FacetKey.return_min_max is true.

Returns
TypeDescription
float

setMaxValue

The maximum value in the FacetValue.interval.

Only supported on numerical facets and returned if SearchRequest.FacetSpec.FacetKey.return_min_max is true.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getFacetValue

Returns
TypeDescription
string