Class FacetProperty (0.1.4)

FacetProperty(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Central configuration for a facet.

This message has oneof_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes

Name Description
fixed_range_bucket_spec google.cloud.visionai_v1alpha1.types.FacetProperty.FixedRangeBucketSpec
Fixed range facet bucket config. This field is a member of oneof_ range_facet_config.
custom_range_bucket_spec google.cloud.visionai_v1alpha1.types.FacetProperty.CustomRangeBucketSpec
Custom range facet bucket config. This field is a member of oneof_ range_facet_config.
datetime_bucket_spec google.cloud.visionai_v1alpha1.types.FacetProperty.DateTimeBucketSpec
Datetime range facet bucket config. This field is a member of oneof_ range_facet_config.
mapped_fields MutableSequence[str]
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 str
Display name of the facet. To be used by UI for facet rendering.
result_size int
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 google.cloud.visionai_v1alpha1.types.FacetBucketType
Facet bucket type e.g. value, range.

Classes

CustomRangeBucketSpec

CustomRangeBucketSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs)

If bucket type is CUSTOM_RANGE, specify how values are bucketized. Use integer bucket value as an example, when the endpoints are 0, 10, 100, and 1000, we will generate the following facets: [-inf, 0), [0, 10), [10, 100), [100, 1000), [1000, inf). Notably:

  • endpoints must be listed in ascending order. Otherwise, the SearchConfig API will reject the facet config.
  • < 1 endpoints is an invalid spec.

DateTimeBucketSpec

DateTimeBucketSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs)

If bucket type is DATE, specify how date values are bucketized.

FixedRangeBucketSpec

FixedRangeBucketSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs)

If bucket type is FIXED_RANGE, specify how values are bucketized. Use FixedRangeBucketSpec when you want to create multiple buckets with equal granularities. Using integer bucket value as an example, when bucket_start = 0, bucket_granularity = 10, bucket_count = 5, this facet will be aggregated via the following buckets: [-inf, 0), [0, 10), [10, 20), [20, 30), [30, inf). Notably, bucket_count <= 1 is an invalid spec.