class Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaCustomAttribute

A custom attribute that is not explicitly modeled in Product.

Attributes

indexable[RW]

If true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details. Corresponds to the JSON property `indexable` @return [Boolean]

indexable?[RW]

If true, custom attribute values are indexed, so that it can be filtered, faceted or boosted in SearchService.Search. This field is ignored in a UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and SearchRequest.boost_spec for more details. Corresponds to the JSON property `indexable` @return [Boolean]

numbers[RW]

The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is “lengths_cm”. At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is returned. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property `numbers` @return [Array<Float>]

searchable[RW]

If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned. Corresponds to the JSON property `searchable` @return [Boolean]

searchable?[RW]

If true, custom attribute values are searchable by text queries in SearchService.Search. This field is ignored in a UserEvent. Only set if type text is set. Otherwise, a INVALID_ARGUMENT error is returned. Corresponds to the JSON property `searchable` @return [Boolean]

text[RW]

The textual values of this custom attribute. For example, `[“yellow”, “green”]` when the key is “color”. At most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters. Otherwise, an INVALID_ARGUMENT error is returned. Exactly one of text or numbers should be set. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property `text` @return [Array<String>]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/retail_v2alpha/classes.rb, line 1070
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/retail_v2alpha/classes.rb, line 1075
def update!(**args)
  @indexable = args[:indexable] if args.key?(:indexable)
  @numbers = args[:numbers] if args.key?(:numbers)
  @searchable = args[:searchable] if args.key?(:searchable)
  @text = args[:text] if args.key?(:text)
end