google-cloud-discovery_engine-v1 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb +20 -3
  3. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb +20 -3
  4. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb +20 -3
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +20 -3
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +20 -3
  7. data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +20 -3
  8. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +20 -3
  9. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +20 -3
  10. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +20 -3
  11. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +20 -3
  12. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +20 -3
  13. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +20 -3
  14. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +20 -3
  15. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +20 -3
  16. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb +20 -3
  17. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb +20 -3
  18. data/lib/google/cloud/discovery_engine/v1/project_service/client.rb +20 -3
  19. data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +20 -3
  20. data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +20 -3
  21. data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +20 -3
  22. data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +20 -3
  23. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +20 -3
  24. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +242 -145
  25. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +222 -142
  26. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb +20 -3
  27. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb +20 -3
  28. data/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb +20 -3
  29. data/lib/google/cloud/discovery_engine/v1/session_service/client.rb +20 -3
  30. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +20 -3
  31. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +20 -3
  32. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +20 -3
  33. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +20 -3
  34. data/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb +20 -3
  35. data/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb +20 -3
  36. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  37. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +3 -1
  38. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +17 -2
  39. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +30 -0
  40. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +463 -113
  41. metadata +1 -1
@@ -42,6 +42,25 @@ module Google
42
42
  # @!attribute [rw] query
43
43
  # @return [::String]
44
44
  # Raw search query.
45
+ # @!attribute [rw] page_categories
46
+ # @return [::Array<::String>]
47
+ # Optional. The categories associated with a category page. Must be set for
48
+ # category navigation queries to achieve good search quality. The format
49
+ # should be the same as
50
+ # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}.
51
+ # This field is the equivalent of the query for browse (navigation) queries.
52
+ # It's used by the browse model when the query is empty.
53
+ #
54
+ # If the field is empty, it will not be used by the browse model.
55
+ # If the field contains more than one element, only the first element will
56
+ # be used.
57
+ #
58
+ # To represent full path of a category, use '>' character to separate
59
+ # different hierarchies. If '>' is part of the category name, replace it with
60
+ # other character(s).
61
+ # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX >
62
+ # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090
63
+ # > Founders Edition`
45
64
  # @!attribute [rw] image_query
46
65
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery]
47
66
  # Raw image query.
@@ -76,6 +95,8 @@ module Google
76
95
  # unset.
77
96
  #
78
97
  # If this field is negative, an `INVALID_ARGUMENT` is returned.
98
+ #
99
+ # A large offset may be capped to a reasonable threshold.
79
100
  # @!attribute [rw] one_box_page_size
80
101
  # @return [::Integer]
81
102
  # The maximum number of results to return for OneBox.
@@ -186,10 +207,10 @@ module Google
186
207
  # which spell correction takes effect.
187
208
  # @!attribute [rw] user_pseudo_id
188
209
  # @return [::String]
189
- # A unique identifier for tracking visitors. For example, this could be
190
- # implemented with an HTTP cookie, which should be able to uniquely identify
191
- # a visitor on a single device. This unique identifier should not change if
192
- # the visitor logs in or out of the website.
210
+ # Optional. A unique identifier for tracking visitors. For example, this
211
+ # could be implemented with an HTTP cookie, which should be able to uniquely
212
+ # identify a visitor on a single device. This unique identifier should not
213
+ # change if the visitor logs in or out of the website.
193
214
  #
194
215
  # This field should NOT have a fixed value such as `unknown_visitor`.
195
216
  #
@@ -203,81 +224,10 @@ module Google
203
224
  # @!attribute [rw] content_search_spec
204
225
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec]
205
226
  # A specification for configuring the behavior of content search.
206
- # @!attribute [rw] safe_search
207
- # @return [::Boolean]
208
- # Whether to turn on safe search. This is only supported for
209
- # website search.
210
- # @!attribute [rw] user_labels
211
- # @return [::Google::Protobuf::Map{::String => ::String}]
212
- # The user labels applied to a resource must meet the following requirements:
213
- #
214
- # * Each resource can have multiple labels, up to a maximum of 64.
215
- # * Each label must be a key-value pair.
216
- # * Keys have a minimum length of 1 character and a maximum length of 63
217
- # characters and cannot be empty. Values can be empty and have a maximum
218
- # length of 63 characters.
219
- # * Keys and values can contain only lowercase letters, numeric characters,
220
- # underscores, and dashes. All characters must use UTF-8 encoding, and
221
- # international characters are allowed.
222
- # * The key portion of a label must be unique. However, you can use the same
223
- # key with multiple resources.
224
- # * Keys must start with a lowercase letter or international character.
225
- #
226
- # See [Google Cloud
227
- # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
228
- # for more details.
229
- # @!attribute [rw] search_as_you_type_spec
230
- # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec]
231
- # Search as you type configuration. Only supported for the
232
- # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA}
233
- # vertical.
234
- # @!attribute [rw] display_spec
235
- # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec]
236
- # Optional. Config for display feature, like match highlighting on search
237
- # results.
238
- # @!attribute [rw] session
239
- # @return [::String]
240
- # The session resource name. Optional.
241
- #
242
- # Session allows users to do multi-turn /search API calls or coordination
243
- # between /search API calls and /answer API calls.
244
- #
245
- # Example #1 (multi-turn /search API calls):
246
- # Call /search API with the session ID generated in the first call.
247
- # Here, the previous search query gets considered in query
248
- # standing. I.e., if the first query is "How did Alphabet do in 2022?"
249
- # and the current query is "How about 2023?", the current query will
250
- # be interpreted as "How did Alphabet do in 2023?".
251
- #
252
- # Example #2 (coordination between /search API calls and /answer API calls):
253
- # Call /answer API with the session ID generated in the first call.
254
- # Here, the answer generation happens in the context of the search
255
- # results from the first search call.
256
- #
257
- # Multi-turn Search feature is currently at private GA stage. Please use
258
- # v1alpha or v1beta version instead before we launch this feature to public
259
- # GA. Or ask for allowlisting through Google Support team.
260
- # @!attribute [rw] session_spec
261
- # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec]
262
- # Session specification.
263
- #
264
- # Can be used only when `session` is set.
265
- # @!attribute [rw] relevance_threshold
266
- # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold]
267
- # The relevance threshold of the search results.
268
- #
269
- # Default to Google defined threshold, leveraging a balance of
270
- # precision and recall to deliver both highly accurate results and
271
- # comprehensive coverage of relevant information.
272
- #
273
- # This feature is not supported for healthcare search.
274
- # @!attribute [rw] relevance_score_spec
275
- # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec]
276
- # Optional. The specification for returning the relevance score.
277
227
  # @!attribute [rw] ranking_expression
278
228
  # @return [::String]
279
- # The ranking expression controls the customized ranking on retrieval
280
- # documents. This overrides
229
+ # Optional. The ranking expression controls the customized ranking on
230
+ # retrieval documents. This overrides
281
231
  # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}.
282
232
  # The syntax and supported features depend on the
283
233
  # `ranking_expression_backend` value. If `ranking_expression_backend` is not
@@ -368,7 +318,100 @@ module Google
368
318
  # * `base_rank`: the default rank of the result
369
319
  # @!attribute [rw] ranking_expression_backend
370
320
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend]
371
- # The backend to use for the ranking expression evaluation.
321
+ # Optional. The backend to use for the ranking expression evaluation.
322
+ # @!attribute [rw] safe_search
323
+ # @return [::Boolean]
324
+ # Whether to turn on safe search. This is only supported for
325
+ # website search.
326
+ # @!attribute [rw] user_labels
327
+ # @return [::Google::Protobuf::Map{::String => ::String}]
328
+ # The user labels applied to a resource must meet the following requirements:
329
+ #
330
+ # * Each resource can have multiple labels, up to a maximum of 64.
331
+ # * Each label must be a key-value pair.
332
+ # * Keys have a minimum length of 1 character and a maximum length of 63
333
+ # characters and cannot be empty. Values can be empty and have a maximum
334
+ # length of 63 characters.
335
+ # * Keys and values can contain only lowercase letters, numeric characters,
336
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
337
+ # international characters are allowed.
338
+ # * The key portion of a label must be unique. However, you can use the same
339
+ # key with multiple resources.
340
+ # * Keys must start with a lowercase letter or international character.
341
+ #
342
+ # See [Google Cloud
343
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
344
+ # for more details.
345
+ # @!attribute [rw] natural_language_query_understanding_spec
346
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec]
347
+ # Optional. Config for natural language query understanding capabilities,
348
+ # such as extracting structured field filters from the query. Refer to [this
349
+ # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries)
350
+ # for more information.
351
+ # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
352
+ # natural language query understanding will be done.
353
+ # @!attribute [rw] search_as_you_type_spec
354
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec]
355
+ # Search as you type configuration. Only supported for the
356
+ # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA}
357
+ # vertical.
358
+ # @!attribute [rw] display_spec
359
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec]
360
+ # Optional. Config for display feature, like match highlighting on search
361
+ # results.
362
+ # @!attribute [rw] crowding_specs
363
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec>]
364
+ # Optional. Crowding specifications for improving result diversity.
365
+ # If multiple CrowdingSpecs are specified, crowding will be evaluated on
366
+ # each unique combination of the `field` values, and max_count will be the
367
+ # maximum value of `max_count` across all CrowdingSpecs.
368
+ # For example, if the first CrowdingSpec has `field` = "color" and
369
+ # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and
370
+ # `max_count` = 2, then after 3 documents that share the same color AND size
371
+ # have been returned, subsequent ones should be
372
+ # removed or demoted.
373
+ # @!attribute [rw] session
374
+ # @return [::String]
375
+ # The session resource name. Optional.
376
+ #
377
+ # Session allows users to do multi-turn /search API calls or coordination
378
+ # between /search API calls and /answer API calls.
379
+ #
380
+ # Example #1 (multi-turn /search API calls):
381
+ # Call /search API with the session ID generated in the first call.
382
+ # Here, the previous search query gets considered in query
383
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
384
+ # and the current query is "How about 2023?", the current query will
385
+ # be interpreted as "How did Alphabet do in 2023?".
386
+ #
387
+ # Example #2 (coordination between /search API calls and /answer API calls):
388
+ # Call /answer API with the session ID generated in the first call.
389
+ # Here, the answer generation happens in the context of the search
390
+ # results from the first search call.
391
+ #
392
+ # Multi-turn Search feature is currently at private GA stage. Please use
393
+ # v1alpha or v1beta version instead before we launch this feature to public
394
+ # GA. Or ask for allowlisting through Google Support team.
395
+ # @!attribute [rw] session_spec
396
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec]
397
+ # Session specification.
398
+ #
399
+ # Can be used only when `session` is set.
400
+ # @!attribute [rw] relevance_threshold
401
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold]
402
+ # The global relevance threshold of the search results.
403
+ #
404
+ # Defaults to Google defined threshold, leveraging a balance of
405
+ # precision and recall to deliver both highly accurate results and
406
+ # comprehensive coverage of relevant information.
407
+ #
408
+ # If more granular relevance filtering is required, use the
409
+ # `relevance_filter_spec` instead.
410
+ #
411
+ # This feature is not supported for healthcare search.
412
+ # @!attribute [rw] relevance_score_spec
413
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec]
414
+ # Optional. The specification for returning the relevance score.
372
415
  class SearchRequest
373
416
  include ::Google::Protobuf::MessageExts
374
417
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -391,6 +434,8 @@ module Google
391
434
  # Required. Full resource name of
392
435
  # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as
393
436
  # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
437
+ # The path must include the project number, project id is not supported for
438
+ # this field.
394
439
  # @!attribute [rw] filter
395
440
  # @return [::String]
396
441
  # Optional. Filter specification to filter documents in the data store
@@ -430,7 +475,6 @@ module Google
430
475
  # @return [::Array<::String>]
431
476
  # List of keys to exclude when faceting.
432
477
  #
433
- #
434
478
  # By default,
435
479
  # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
436
480
  # is not excluded from the filter unless it is listed in this field.
@@ -1025,6 +1069,77 @@ module Google
1025
1069
  end
1026
1070
  end
1027
1071
 
1072
+ # Specification to enable natural language understanding capabilities for
1073
+ # search requests.
1074
+ # @!attribute [rw] filter_extraction_condition
1075
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition]
1076
+ # The condition under which filter extraction should occur.
1077
+ # Server behavior defaults to `DISABLED`.
1078
+ # @!attribute [rw] geo_search_query_detection_field_names
1079
+ # @return [::Array<::String>]
1080
+ # Field names used for location-based filtering, where geolocation filters
1081
+ # are detected in natural language search queries.
1082
+ # Only valid when the FilterExtractionCondition is set to `ENABLED`.
1083
+ #
1084
+ # If this field is set, it overrides the field names set in
1085
+ # [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1.ServingConfig.geo_search_query_detection_field_names].
1086
+ # @!attribute [rw] extracted_filter_behavior
1087
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior]
1088
+ # Optional. Controls behavior of how extracted filters are applied to the
1089
+ # search. The default behavior depends on the request. For single datastore
1090
+ # structured search, the default is `HARD_FILTER`. For multi-datastore
1091
+ # search, the default behavior is `SOFT_BOOST`.
1092
+ # Location-based filters are always applied as hard filters, and the
1093
+ # `SOFT_BOOST` setting will not affect them.
1094
+ # This field is only used if
1095
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition}
1096
+ # is set to
1097
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}.
1098
+ # @!attribute [rw] allowed_field_names
1099
+ # @return [::Array<::String>]
1100
+ # Optional. Allowlist of fields that can be used for natural language
1101
+ # filter extraction. By default, if this is unspecified, all indexable
1102
+ # fields are eligible for natural language filter extraction (but are not
1103
+ # guaranteed to be used). If any fields are specified in
1104
+ # allowed_field_names, only the fields that are both marked as indexable in
1105
+ # the schema and specified in the allowlist will be eligible for natural
1106
+ # language filter extraction. Note: for multi-datastore search, this is not
1107
+ # yet supported, and will be ignored.
1108
+ class NaturalLanguageQueryUnderstandingSpec
1109
+ include ::Google::Protobuf::MessageExts
1110
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1111
+
1112
+ # Enum describing under which condition filter extraction should occur.
1113
+ module FilterExtractionCondition
1114
+ # Server behavior defaults to `DISABLED`.
1115
+ CONDITION_UNSPECIFIED = 0
1116
+
1117
+ # Disables NL filter extraction.
1118
+ DISABLED = 1
1119
+
1120
+ # Enables NL filter extraction.
1121
+ ENABLED = 2
1122
+ end
1123
+
1124
+ # Enum describing how extracted filters are applied to the search.
1125
+ module ExtractedFilterBehavior
1126
+ # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
1127
+ # for extracted filters. For single datastore search, the default is to
1128
+ # apply as hard filters. For multi-datastore search, the default is to
1129
+ # apply as soft boosts.
1130
+ EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0
1131
+
1132
+ # Applies all extracted filters as hard filters on the results. Results
1133
+ # that do not pass the extracted filters will not be returned in the
1134
+ # result set.
1135
+ HARD_FILTER = 1
1136
+
1137
+ # Applies all extracted filters as soft boosts. Results that pass the
1138
+ # filters will be boosted up to higher ranks in the result set.
1139
+ SOFT_BOOST = 2
1140
+ end
1141
+ end
1142
+
1028
1143
  # Specification for search as you type in search requests.
1029
1144
  # @!attribute [rw] condition
1030
1145
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition]
@@ -1074,6 +1189,45 @@ module Google
1074
1189
  end
1075
1190
  end
1076
1191
 
1192
+ # Specification for crowding. Crowding improves the diversity of search
1193
+ # results by limiting the number of results that share the same field value.
1194
+ # For example, crowding on the color field with a max_count of 3 and mode
1195
+ # DROP_CROWDED_RESULTS will return at most 3 results with the same color
1196
+ # across all pages.
1197
+ # @!attribute [rw] field
1198
+ # @return [::String]
1199
+ # The field to use for crowding. Documents can be crowded by a field in the
1200
+ # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. Crowding
1201
+ # field is case sensitive.
1202
+ # @!attribute [rw] max_count
1203
+ # @return [::Integer]
1204
+ # The maximum number of documents to keep per value of the field. Once
1205
+ # there are at least max_count previous results which contain the same
1206
+ # value for the given field (according to the order specified in
1207
+ # `order_by`), later results with the same value are "crowded away".
1208
+ # If not specified, the default value is 1.
1209
+ # @!attribute [rw] mode
1210
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode]
1211
+ # Mode to use for documents that are crowded away.
1212
+ class CrowdingSpec
1213
+ include ::Google::Protobuf::MessageExts
1214
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1215
+
1216
+ # Enum describing the mode to use for documents that are crowded away.
1217
+ # They can be dropped or demoted to the later pages.
1218
+ module Mode
1219
+ # Unspecified crowding mode. In this case, server behavior defaults to
1220
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}.
1221
+ MODE_UNSPECIFIED = 0
1222
+
1223
+ # Drop crowded results.
1224
+ DROP_CROWDED_RESULTS = 1
1225
+
1226
+ # Demote crowded results to the later pages.
1227
+ DEMOTE_CROWDED_RESULTS_TO_END = 2
1228
+ end
1229
+ end
1230
+
1077
1231
  # Session specification.
1078
1232
  #
1079
1233
  # Multi-turn Search feature is currently at private GA stage. Please use
@@ -1148,6 +1302,30 @@ module Google
1148
1302
  extend ::Google::Protobuf::MessageExts::ClassMethods
1149
1303
  end
1150
1304
 
1305
+ # The backend to use for the ranking expression evaluation.
1306
+ module RankingExpressionBackend
1307
+ # Default option for unspecified/unknown values.
1308
+ RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0
1309
+
1310
+ # Deprecated: Use `RANK_BY_EMBEDDING` instead.
1311
+ # Ranking by custom embedding model, the default way to evaluate the
1312
+ # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
1313
+ # used instead.
1314
+ BYOE = 1
1315
+
1316
+ # Deprecated: Use `RANK_BY_FORMULA` instead.
1317
+ # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
1318
+ # be used instead.
1319
+ CLEARBOX = 2
1320
+
1321
+ # Ranking by custom embedding model, the default way to evaluate the
1322
+ # ranking expression.
1323
+ RANK_BY_EMBEDDING = 3
1324
+
1325
+ # Ranking by custom formula.
1326
+ RANK_BY_FORMULA = 4
1327
+ end
1328
+
1151
1329
  # The relevance threshold of the search results. The higher relevance
1152
1330
  # threshold is, the higher relevant results are shown and the less number of
1153
1331
  # results are returned.
@@ -1168,19 +1346,6 @@ module Google
1168
1346
  # High relevance threshold.
1169
1347
  HIGH = 4
1170
1348
  end
1171
-
1172
- # The backend to use for the ranking expression evaluation.
1173
- module RankingExpressionBackend
1174
- # Default option for unspecified/unknown values.
1175
- RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0
1176
-
1177
- # Ranking by custom embedding model, the default way to evaluate the
1178
- # ranking expression.
1179
- RANK_BY_EMBEDDING = 3
1180
-
1181
- # Ranking by custom formula.
1182
- RANK_BY_FORMULA = 4
1183
- end
1184
1349
  end
1185
1350
 
1186
1351
  # Response message for
@@ -1234,6 +1399,10 @@ module Google
1234
1399
  # @!attribute [rw] query_expansion_info
1235
1400
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo]
1236
1401
  # Query expansion information for the returned results.
1402
+ # @!attribute [r] natural_language_query_understanding_info
1403
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo]
1404
+ # Output only. Natural language query understanding information for the
1405
+ # returned results.
1237
1406
  # @!attribute [rw] session_info
1238
1407
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SessionInfo]
1239
1408
  # Session information.
@@ -1244,6 +1413,9 @@ module Google
1244
1413
  # @!attribute [rw] search_link_promotions
1245
1414
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchLinkPromotion>]
1246
1415
  # Promotions for site search.
1416
+ # @!attribute [r] semantic_state
1417
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SemanticState]
1418
+ # Output only. Indicates the semantic state of the search response.
1247
1419
  class SearchResponse
1248
1420
  include ::Google::Protobuf::MessageExts
1249
1421
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -1268,48 +1440,39 @@ module Google
1268
1440
  # Output only. Google provided available scores.
1269
1441
  # @!attribute [rw] rank_signals
1270
1442
  # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals]
1271
- # A set of ranking signals associated with the result.
1443
+ # Optional. A set of ranking signals associated with the result.
1272
1444
  class SearchResult
1273
1445
  include ::Google::Protobuf::MessageExts
1274
1446
  extend ::Google::Protobuf::MessageExts::ClassMethods
1275
1447
 
1276
- # @!attribute [rw] key
1277
- # @return [::String]
1278
- # @!attribute [rw] value
1279
- # @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
1280
- class ModelScoresEntry
1281
- include ::Google::Protobuf::MessageExts
1282
- extend ::Google::Protobuf::MessageExts::ClassMethods
1283
- end
1284
-
1285
1448
  # A set of ranking signals.
1286
1449
  # @!attribute [rw] keyword_similarity_score
1287
1450
  # @return [::Float]
1288
- # Keyword matching adjustment.
1451
+ # Optional. Keyword matching adjustment.
1289
1452
  # @!attribute [rw] relevance_score
1290
1453
  # @return [::Float]
1291
- # Semantic relevance adjustment.
1454
+ # Optional. Semantic relevance adjustment.
1292
1455
  # @!attribute [rw] semantic_similarity_score
1293
1456
  # @return [::Float]
1294
- # Semantic similarity adjustment.
1457
+ # Optional. Semantic similarity adjustment.
1295
1458
  # @!attribute [rw] pctr_rank
1296
1459
  # @return [::Float]
1297
- # Predicted conversion rate adjustment as a rank.
1460
+ # Optional. Predicted conversion rate adjustment as a rank.
1298
1461
  # @!attribute [rw] topicality_rank
1299
1462
  # @return [::Float]
1300
- # Topicality adjustment as a rank.
1463
+ # Optional. Topicality adjustment as a rank.
1301
1464
  # @!attribute [rw] document_age
1302
1465
  # @return [::Float]
1303
- # Age of the document in hours.
1466
+ # Optional. Age of the document in hours.
1304
1467
  # @!attribute [rw] boosting_factor
1305
1468
  # @return [::Float]
1306
- # Combined custom boosts for a doc.
1469
+ # Optional. Combined custom boosts for a doc.
1307
1470
  # @!attribute [rw] default_rank
1308
1471
  # @return [::Float]
1309
- # The default rank of the result.
1472
+ # Optional. The default rank of the result.
1310
1473
  # @!attribute [rw] custom_signals
1311
1474
  # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>]
1312
- # A list of custom clearbox signals.
1475
+ # Optional. A list of custom clearbox signals.
1313
1476
  class RankSignals
1314
1477
  include ::Google::Protobuf::MessageExts
1315
1478
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -1317,15 +1480,25 @@ module Google
1317
1480
  # Custom clearbox signal represented by name and value pair.
1318
1481
  # @!attribute [rw] name
1319
1482
  # @return [::String]
1320
- # Name of the signal.
1483
+ # Optional. Name of the signal.
1321
1484
  # @!attribute [rw] value
1322
1485
  # @return [::Float]
1323
- # Float value representing the ranking signal (e.g. 1.25 for BM25).
1486
+ # Optional. Float value representing the ranking signal (e.g. 1.25 for
1487
+ # BM25).
1324
1488
  class CustomSignal
1325
1489
  include ::Google::Protobuf::MessageExts
1326
1490
  extend ::Google::Protobuf::MessageExts::ClassMethods
1327
1491
  end
1328
1492
  end
1493
+
1494
+ # @!attribute [rw] key
1495
+ # @return [::String]
1496
+ # @!attribute [rw] value
1497
+ # @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList]
1498
+ class ModelScoresEntry
1499
+ include ::Google::Protobuf::MessageExts
1500
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1501
+ end
1329
1502
  end
1330
1503
 
1331
1504
  # A facet result.
@@ -1570,6 +1743,171 @@ module Google
1570
1743
  extend ::Google::Protobuf::MessageExts::ClassMethods
1571
1744
  end
1572
1745
 
1746
+ # Information describing what natural language understanding was
1747
+ # done on the input query.
1748
+ # @!attribute [rw] extracted_filters
1749
+ # @return [::String]
1750
+ # The filters that were extracted from the input query.
1751
+ # @!attribute [rw] rewritten_query
1752
+ # @return [::String]
1753
+ # Rewritten input query minus the extracted filters.
1754
+ # @!attribute [rw] classified_intents
1755
+ # @return [::Array<::String>]
1756
+ # The classified intents from the input query.
1757
+ # @!attribute [rw] structured_extracted_filter
1758
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter]
1759
+ # The filters that were extracted from the input query represented in a
1760
+ # structured form.
1761
+ class NaturalLanguageQueryUnderstandingInfo
1762
+ include ::Google::Protobuf::MessageExts
1763
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1764
+
1765
+ # The filters that were extracted from the input query represented in a
1766
+ # structured form.
1767
+ # @!attribute [rw] expression
1768
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression]
1769
+ # The expression denoting the filter that was extracted from the input
1770
+ # query in a structured form. It can be a simple expression denoting a
1771
+ # single string, numerical or geolocation constraint or a compound
1772
+ # expression which is a combination of multiple expressions connected
1773
+ # using logical (OR and AND) operators.
1774
+ class StructuredExtractedFilter
1775
+ include ::Google::Protobuf::MessageExts
1776
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1777
+
1778
+ # Constraint expression of a string field.
1779
+ # @!attribute [rw] field_name
1780
+ # @return [::String]
1781
+ # Name of the string field as defined in the schema.
1782
+ # @!attribute [rw] values
1783
+ # @return [::Array<::String>]
1784
+ # Values of the string field. The record will only be returned if the
1785
+ # field value matches one of the values specified here.
1786
+ # @!attribute [rw] query_segment
1787
+ # @return [::String]
1788
+ # Identifies the keywords within the search query that match a filter.
1789
+ class StringConstraint
1790
+ include ::Google::Protobuf::MessageExts
1791
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1792
+ end
1793
+
1794
+ # Constraint expression of a number field. Example: price < 100.
1795
+ # @!attribute [rw] field_name
1796
+ # @return [::String]
1797
+ # Name of the numerical field as defined in the schema.
1798
+ # @!attribute [rw] comparison
1799
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison]
1800
+ # The comparison operation performed between the field value and the
1801
+ # value specified in the constraint.
1802
+ # @!attribute [rw] value
1803
+ # @return [::Float]
1804
+ # The value specified in the numerical constraint.
1805
+ # @!attribute [rw] query_segment
1806
+ # @return [::String]
1807
+ # Identifies the keywords within the search query that match a filter.
1808
+ class NumberConstraint
1809
+ include ::Google::Protobuf::MessageExts
1810
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1811
+
1812
+ # The comparison operation that was performed.
1813
+ module Comparison
1814
+ # Undefined comparison operator.
1815
+ COMPARISON_UNSPECIFIED = 0
1816
+
1817
+ # Denotes equality `=` operator.
1818
+ EQUALS = 1
1819
+
1820
+ # Denotes less than or equal to `<=` operator.
1821
+ LESS_THAN_EQUALS = 2
1822
+
1823
+ # Denotes less than `<` operator.
1824
+ LESS_THAN = 3
1825
+
1826
+ # Denotes greater than or equal to `>=` operator.
1827
+ GREATER_THAN_EQUALS = 4
1828
+
1829
+ # Denotes greater than `>` operator.
1830
+ GREATER_THAN = 5
1831
+ end
1832
+ end
1833
+
1834
+ # Constraint of a geolocation field.
1835
+ # Name of the geolocation field as defined in the schema.
1836
+ # @!attribute [rw] field_name
1837
+ # @return [::String]
1838
+ # The name of the geolocation field as defined in the schema.
1839
+ # @!attribute [rw] address
1840
+ # @return [::String]
1841
+ # The reference address that was inferred from the input query. The
1842
+ # proximity of the reference address to the geolocation field will be
1843
+ # used to filter the results.
1844
+ # @!attribute [rw] latitude
1845
+ # @return [::Float]
1846
+ # The latitude of the geolocation inferred from the input query.
1847
+ # @!attribute [rw] longitude
1848
+ # @return [::Float]
1849
+ # The longitude of the geolocation inferred from the input query.
1850
+ # @!attribute [rw] radius_in_meters
1851
+ # @return [::Float]
1852
+ # The radius in meters around the address. The record is returned if
1853
+ # the location of the geolocation field is within the radius.
1854
+ class GeolocationConstraint
1855
+ include ::Google::Protobuf::MessageExts
1856
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1857
+ end
1858
+
1859
+ # Logical `And` operator.
1860
+ # @!attribute [rw] expressions
1861
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>]
1862
+ # The expressions that were ANDed together.
1863
+ class AndExpression
1864
+ include ::Google::Protobuf::MessageExts
1865
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1866
+ end
1867
+
1868
+ # Logical `Or` operator.
1869
+ # @!attribute [rw] expressions
1870
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>]
1871
+ # The expressions that were ORed together.
1872
+ class OrExpression
1873
+ include ::Google::Protobuf::MessageExts
1874
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1875
+ end
1876
+
1877
+ # The expression denoting the filter that was extracted from the input
1878
+ # query.
1879
+ # @!attribute [rw] string_constraint
1880
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint]
1881
+ # String constraint expression.
1882
+ #
1883
+ # Note: The following fields are mutually exclusive: `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1884
+ # @!attribute [rw] number_constraint
1885
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint]
1886
+ # Numerical constraint expression.
1887
+ #
1888
+ # Note: The following fields are mutually exclusive: `number_constraint`, `string_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1889
+ # @!attribute [rw] geolocation_constraint
1890
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint]
1891
+ # Geolocation constraint expression.
1892
+ #
1893
+ # Note: The following fields are mutually exclusive: `geolocation_constraint`, `string_constraint`, `number_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1894
+ # @!attribute [rw] and_expr
1895
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression]
1896
+ # Logical "And" compound operator connecting multiple expressions.
1897
+ #
1898
+ # Note: The following fields are mutually exclusive: `and_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1899
+ # @!attribute [rw] or_expr
1900
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression]
1901
+ # Logical "Or" compound operator connecting multiple expressions.
1902
+ #
1903
+ # Note: The following fields are mutually exclusive: `or_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1904
+ class Expression
1905
+ include ::Google::Protobuf::MessageExts
1906
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1907
+ end
1908
+ end
1909
+ end
1910
+
1573
1911
  # Information about the session.
1574
1912
  # @!attribute [rw] name
1575
1913
  # @return [::String]
@@ -1589,6 +1927,18 @@ module Google
1589
1927
  include ::Google::Protobuf::MessageExts
1590
1928
  extend ::Google::Protobuf::MessageExts::ClassMethods
1591
1929
  end
1930
+
1931
+ # Semantic state of the search response.
1932
+ module SemanticState
1933
+ # Default value. Should not be used.
1934
+ SEMANTIC_STATE_UNSPECIFIED = 0
1935
+
1936
+ # Semantic search was disabled for this search response.
1937
+ DISABLED = 1
1938
+
1939
+ # Semantic search was enabled for this search response.
1940
+ ENABLED = 2
1941
+ end
1592
1942
  end
1593
1943
  end
1594
1944
  end