Google Cloud Vision Ai V1 Client - Class FacetProperty (0.1.0)

Reference documentation and code samples for the Google Cloud Vision Ai V1 Client class FacetProperty.

Central configuration for a facet.

Generated from protobuf message google.cloud.visionai.v1.FacetProperty

Namespace

Google \ Cloud \ VisionAI \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ fixed_range_bucket_spec FacetProperty\FixedRangeBucketSpec

Fixed range facet bucket config.

↳ custom_range_bucket_spec FacetProperty\CustomRangeBucketSpec

Custom range facet bucket config.

↳ datetime_bucket_spec FacetProperty\DateTimeBucketSpec

Datetime range facet bucket config.

↳ mapped_fields array

Name of the facets, which are the dimensions users want to use to refine search results. mapped_fields will match UserSpecifiedDataSchema keys. For example, user can add a bunch of UGAs with the same key, such as player:adam, player:bob, player:charles. When multiple mapped_fields are specified, will merge their value together as final facet value. E.g. home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = [home_team, away_team], facet_value will be [a, b, c]. UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the mapped_field equals the parent SearchConfig.name, the parent must also contain a SearchCriteriaProperty that maps to the same fields. mapped_fields must not be empty.

↳ display_name string

Display name of the facet. To be used by UI for facet rendering.

↳ result_size int|string

Maximum number of unique bucket to return for one facet. Bucket number can be large for high-cardinality facet such as "player". We only return top-n most related ones to user. If it's <= 0, the server will decide the appropriate result_size.

↳ bucket_type int

Facet bucket type e.g. value, range.

getFixedRangeBucketSpec

Fixed range facet bucket config.

Returns
Type Description
FacetProperty\FixedRangeBucketSpec|null

hasFixedRangeBucketSpec

setFixedRangeBucketSpec

Fixed range facet bucket config.

Parameter
Name Description
var FacetProperty\FixedRangeBucketSpec
Returns
Type Description
$this

getCustomRangeBucketSpec

Custom range facet bucket config.

Returns
Type Description
FacetProperty\CustomRangeBucketSpec|null

hasCustomRangeBucketSpec

setCustomRangeBucketSpec

Custom range facet bucket config.

Parameter
Name Description
var FacetProperty\CustomRangeBucketSpec
Returns
Type Description
$this

getDatetimeBucketSpec

Datetime range facet bucket config.

Returns
Type Description
FacetProperty\DateTimeBucketSpec|null

hasDatetimeBucketSpec

setDatetimeBucketSpec

Datetime range facet bucket config.

Parameter
Name Description
var FacetProperty\DateTimeBucketSpec
Returns
Type Description
$this

getMappedFields

Name of the facets, which are the dimensions users want to use to refine search results. mapped_fields will match UserSpecifiedDataSchema keys.

For example, user can add a bunch of UGAs with the same key, such as player:adam, player:bob, player:charles. When multiple mapped_fields are specified, will merge their value together as final facet value. E.g. home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = [home_team, away_team], facet_value will be [a, b, c]. UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the mapped_field equals the parent SearchConfig.name, the parent must also contain a SearchCriteriaProperty that maps to the same fields. mapped_fields must not be empty.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setMappedFields

Name of the facets, which are the dimensions users want to use to refine search results. mapped_fields will match UserSpecifiedDataSchema keys.

For example, user can add a bunch of UGAs with the same key, such as player:adam, player:bob, player:charles. When multiple mapped_fields are specified, will merge their value together as final facet value. E.g. home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = [home_team, away_team], facet_value will be [a, b, c]. UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the mapped_field equals the parent SearchConfig.name, the parent must also contain a SearchCriteriaProperty that maps to the same fields. mapped_fields must not be empty.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getDisplayName

Display name of the facet. To be used by UI for facet rendering.

Returns
Type Description
string

setDisplayName

Display name of the facet. To be used by UI for facet rendering.

Parameter
Name Description
var string
Returns
Type Description
$this

getResultSize

Maximum number of unique bucket to return for one facet. Bucket number can be large for high-cardinality facet such as "player". We only return top-n most related ones to user. If it's <= 0, the server will decide the appropriate result_size.

Returns
Type Description
int|string

setResultSize

Maximum number of unique bucket to return for one facet. Bucket number can be large for high-cardinality facet such as "player". We only return top-n most related ones to user. If it's <= 0, the server will decide the appropriate result_size.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getBucketType

Facet bucket type e.g. value, range.

Returns
Type Description
int Enum of type FacetBucketType.

setBucketType

Facet bucket type e.g. value, range.

Parameter
Name Description
var int

Enum of type FacetBucketType.

Returns
Type Description
$this

getRangeFacetConfig

Returns
Type Description
string