Class: Google::Apis::DiscoveryengineV1beta::GoogleCloudDiscoveryengineV1alphaSearchRequestCrowdingSpec

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

Overview

Specification for crowding. Crowding improves the diversity of search results by limiting the number of results that share the same field value. For example, crowding on the color field with a max_count of 3 and mode DROP_CROWDED_RESULTS will return at most 3 results with the same color across all pages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDiscoveryengineV1alphaSearchRequestCrowdingSpec

Returns a new instance of GoogleCloudDiscoveryengineV1alphaSearchRequestCrowdingSpec.



16052
16053
16054
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 16052

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

Instance Attribute Details

#fieldString

The field to use for crowding. Documents can be crowded by a field in the Document object. Crowding field is case sensitive. Corresponds to the JSON property field

Returns:

  • (String)


16037
16038
16039
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 16037

def field
  @field
end

#max_countFixnum

The maximum number of documents to keep per value of the field. Once there are at least max_count previous results which contain the same value for the given field (according to the order specified in order_by), later results with the same value are "crowded away". If not specified, the default value is 1. Corresponds to the JSON property maxCount

Returns:

  • (Fixnum)


16045
16046
16047
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 16045

def max_count
  @max_count
end

#modeString

Mode to use for documents that are crowded away. Corresponds to the JSON property mode

Returns:

  • (String)


16050
16051
16052
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 16050

def mode
  @mode
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



16057
16058
16059
16060
16061
# File 'lib/google/apis/discoveryengine_v1beta/classes.rb', line 16057

def update!(**args)
  @field = args[:field] if args.key?(:field)
  @max_count = args[:max_count] if args.key?(:max_count)
  @mode = args[:mode] if args.key?(:mode)
end