Class: Google::Apis::DiscoveryengineV1alpha::GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/discoveryengine_v1alpha/classes.rb,
lib/google/apis/discoveryengine_v1alpha/representations.rb,
lib/google/apis/discoveryengine_v1alpha/representations.rb

Overview

Specifies how a facet is computed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey

Returns a new instance of GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey.



3408
3409
3410
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3408

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#case_insensitiveBoolean Also known as: case_insensitive?

True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise. Corresponds to the JSON property caseInsensitive

Returns:

  • (Boolean)


3356
3357
3358
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3356

def case_insensitive
  @case_insensitive
end

#containsArray<String>

Only get facet values that contains the given strings. For example, suppose " category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > 2022" . If set "contains" to "2022", the "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". Only supported on textual fields. Maximum is 10. Corresponds to the JSON property contains

Returns:

  • (Array<String>)


3365
3366
3367
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3365

def contains
  @contains
end

#intervalsArray<Google::Apis::DiscoveryengineV1alpha::GoogleCloudDiscoveryengineV1alphaInterval>

Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30. Corresponds to the JSON property intervals



3372
3373
3374
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3372

def intervals
  @intervals
end

#keyString

Required. Supported textual and numerical facet keys in Document object, over which the facet values are computed. Facet key is case-sensitive. Corresponds to the JSON property key

Returns:

  • (String)


3378
3379
3380
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3378

def key
  @key
end

#order_byString

The order in which documents are returned. Allowed values are: * "count desc", which means order by SearchResponse.Facet.values.count descending. * "value desc", which means order by SearchResponse.Facet.values.value descending. Only applies to textual facets. If not set, textual values are sorted in natural order; numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals. Corresponds to the JSON property orderBy

Returns:

  • (String)


3388
3389
3390
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3388

def order_by
  @order_by
end

#prefixesArray<String>

Only get facet values that start with the given string prefix. For example, suppose "category" has three values "Action > 2022", "Action > 2021" and "Sci- Fi > 2022". If set "prefixes" to "Action", the "category" facet only contains " Action > 2022" and "Action > 2021". Only supported on textual fields. Maximum is 10. Corresponds to the JSON property prefixes

Returns:

  • (Array<String>)


3397
3398
3399
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3397

def prefixes
  @prefixes
end

#restricted_valuesArray<String>

Only get facet for the given restricted values. Only supported on textual fields. For example, suppose "category" has three values "Action > 2022", " Action > 2021" and "Sci-Fi > 2022". If set "restricted_values" to "Action > 2022", the "category" facet only contains "Action > 2022". Only supported on textual fields. Maximum is 10. Corresponds to the JSON property restrictedValues

Returns:

  • (Array<String>)


3406
3407
3408
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3406

def restricted_values
  @restricted_values
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3413
3414
3415
3416
3417
3418
3419
3420
3421
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 3413

def update!(**args)
  @case_insensitive = args[:case_insensitive] if args.key?(:case_insensitive)
  @contains = args[:contains] if args.key?(:contains)
  @intervals = args[:intervals] if args.key?(:intervals)
  @key = args[:key] if args.key?(:key)
  @order_by = args[:order_by] if args.key?(:order_by)
  @prefixes = args[:prefixes] if args.key?(:prefixes)
  @restricted_values = args[:restricted_values] if args.key?(:restricted_values)
end