Class: Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/discoveryengine/v1/search_service.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.

Defined Under Namespace

Modules: Mode

Instance Attribute Summary collapse

Instance Attribute Details

#field::String

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

Returns:

  • (::String)

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



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1212

class CrowdingSpec
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Enum describing the mode to use for documents that are crowded away.
  # They can be dropped or demoted to the later pages.
  module Mode
    # Unspecified crowding mode. In this case, server behavior defaults to
    # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
    MODE_UNSPECIFIED = 0

    # Drop crowded results.
    DROP_CROWDED_RESULTS = 1

    # Demote crowded results to the later pages.
    DEMOTE_CROWDED_RESULTS_TO_END = 2
  end
end

#max_count::Integer

Returns 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.

Returns:

  • (::Integer)

    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.



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1212

class CrowdingSpec
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Enum describing the mode to use for documents that are crowded away.
  # They can be dropped or demoted to the later pages.
  module Mode
    # Unspecified crowding mode. In this case, server behavior defaults to
    # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
    MODE_UNSPECIFIED = 0

    # Drop crowded results.
    DROP_CROWDED_RESULTS = 1

    # Demote crowded results to the later pages.
    DEMOTE_CROWDED_RESULTS_TO_END = 2
  end
end

#mode::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode

Returns Mode to use for documents that are crowded away.

Returns:



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'proto_docs/google/cloud/discoveryengine/v1/search_service.rb', line 1212

class CrowdingSpec
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Enum describing the mode to use for documents that are crowded away.
  # They can be dropped or demoted to the later pages.
  module Mode
    # Unspecified crowding mode. In this case, server behavior defaults to
    # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
    MODE_UNSPECIFIED = 0

    # Drop crowded results.
    DROP_CROWDED_RESULTS = 1

    # Demote crowded results to the later pages.
    DEMOTE_CROWDED_RESULTS_TO_END = 2
  end
end