Skip to content

Commit d6bce0e

Browse files
Google APIscopybara-github
authored andcommitted
feat: support case insensitive match on search facets
feat: allow disabling spell check in search requests feat: allow adding labels in search requests feat: allow returning min/max values on search numeric facets feat: allow using serving configs as an alias of placements feat: allow enabling recommendation filtering on custom attributes feat: return output BigQuery table on product / event export response docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 463980128
1 parent 37aaa1e commit d6bce0e

17 files changed

+454
-172
lines changed

google/cloud/retail/v2beta/catalog.proto

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ message ProductLevelConfig {
4242
// default to
4343
// [Product.Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]
4444
// if unset.
45-
// * `variant`: You can only ingest
46-
// [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
47-
// [Product][google.cloud.retail.v2beta.Product]s.
48-
// This means
45+
// * `variant` (incompatible with Retail Search): You can only
46+
// ingest
47+
// [Product.Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]
48+
// [Product][google.cloud.retail.v2beta.Product]s. This means
4949
// [Product.primary_product_id][google.cloud.retail.v2beta.Product.primary_product_id]
5050
// cannot be empty.
5151
//
@@ -56,8 +56,8 @@ message ProductLevelConfig {
5656
// [merchant_center_product_id_field][google.cloud.retail.v2beta.ProductLevelConfig.merchant_center_product_id_field]
5757
// is `itemGroupId`, an INVALID_ARGUMENT error is returned.
5858
//
59-
// See [Using product
60-
// levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
59+
// See [Product
60+
// levels](https://cloud.google.com/retail/docs/catalog#product-levels)
6161
// for more details.
6262
string ingestion_product_type = 1;
6363

@@ -78,8 +78,8 @@ message ProductLevelConfig {
7878
// [ingestion_product_type][google.cloud.retail.v2beta.ProductLevelConfig.ingestion_product_type]
7979
// is `variant`, an INVALID_ARGUMENT error is returned.
8080
//
81-
// See [Using product
82-
// levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
81+
// See [Product
82+
// levels](https://cloud.google.com/retail/docs/catalog#product-levels)
8383
// for more details.
8484
string merchant_center_product_id_field = 2;
8585
}
@@ -144,6 +144,10 @@ message CatalogAttribute {
144144
// Required. Attribute name.
145145
// For example: `color`, `brands`, `attributes.custom_attribute`, such as
146146
// `attributes.xyz`.
147+
// To be indexable, the attribute name can contain only alpha-numeric
148+
// characters and underscores. For example, an attribute named
149+
// `attributes.abc_xyz` can be indexed, but an attribute named
150+
// `attributes.abc-xyz` cannot be indexed.
147151
string key = 1 [(google.api.field_behavior) = REQUIRED];
148152

149153
// Output only. Indicates whether this attribute has been used by any
@@ -153,15 +157,20 @@ message CatalogAttribute {
153157
// Otherwise, this field is `False`.
154158
//
155159
// [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] can be
156-
// pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
157-
// or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
160+
// pre-loaded by using
161+
// [CatalogService.AddCatalogAttribute][google.cloud.retail.v2beta.CatalogService.AddCatalogAttribute],
162+
// [CatalogService.ImportCatalogAttributes][], or
163+
// [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2beta.CatalogService.UpdateAttributesConfig]
164+
// APIs. This field is `False` for pre-loaded
158165
// [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s.
159166
//
160-
// Only [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that
161-
// are not in use by products can be deleted.
167+
// Only pre-loaded
162168
// [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
163-
// in use by products cannot be deleted; however, their configuration
164-
// properties will reset to default values upon removal request.
169+
// neither in use by products nor predefined can be deleted.
170+
// [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s that are
171+
// either in use by products or are predefined cannot be deleted; however,
172+
// their configuration properties will reset to default values upon removal
173+
// request.
165174
//
166175
// After catalog changes, it takes about 10 minutes for this field to update.
167176
bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -194,6 +203,14 @@ message CatalogAttribute {
194203
// [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as
195204
// there are no text values associated to numerical attributes.
196205
SearchableOption searchable_option = 7;
206+
207+
// When
208+
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
209+
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if RECOMMENDATIONS_FILTERING_ENABLED,
210+
// attribute values are filterable for recommendations.
211+
// This option works for categorical features only,
212+
// does not work for numerical features, inventory filtering.
213+
RecommendationsFilteringOption recommendations_filtering_option = 8;
197214
}
198215

199216
// Catalog level attribute config.
@@ -254,14 +271,18 @@ message CompletionConfig {
254271
// Default value: 'exact-prefix'.
255272
string matching_order = 2;
256273

257-
// The maximum number of autocomplete suggestions returned per term. The
258-
// maximum allowed max suggestions is 20. Default value is 20. If left unset
259-
// or set to 0, then will fallback to default value.
274+
// The maximum number of autocomplete suggestions returned per term. Default
275+
// value is 20. If left unset or set to 0, then will fallback to default
276+
// value.
277+
//
278+
// Value range is 1 to 20.
260279
int32 max_suggestions = 3;
261280

262281
// The minimum number of characters needed to be typed in order to get
263282
// suggestions. Default value is 2. If left unset or set to 0, then will
264283
// fallback to default value.
284+
//
285+
// Value range is 1 to 20.
265286
int32 min_prefix_length = 4;
266287

267288
// If set to true, the auto learning function is enabled. Auto learning uses
@@ -271,8 +292,8 @@ message CompletionConfig {
271292
// [CompleteQueryRequest][google.cloud.retail.v2beta.CompleteQueryRequest].
272293
bool auto_learning = 11;
273294

274-
// Output only. The input config for the import of the source data that
275-
// contains the autocomplete phrases uploaded by the customer.
295+
// Output only. The source data for the latest import of the autocomplete
296+
// suggestion phrases.
276297
CompletionDataInputConfig suggestions_input_config = 5
277298
[(google.api.field_behavior) = OUTPUT_ONLY];
278299

@@ -284,24 +305,24 @@ message CompletionConfig {
284305
string last_suggestions_import_operation = 6
285306
[(google.api.field_behavior) = OUTPUT_ONLY];
286307

287-
// Output only. The input config for the import of the source data that
288-
// contains the / autocomplete denylist phrases uploaded by the customer.
308+
// Output only. The source data for the latest import of the autocomplete
309+
// denylist phrases.
289310
CompletionDataInputConfig denylist_input_config = 7
290311
[(google.api.field_behavior) = OUTPUT_ONLY];
291312

292-
// Output only. LRO corresponding to the latest denylist import.
313+
// Output only. Name of the LRO corresponding to the latest denylist import.
293314
//
294315
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
295316
// retrieve the latest state of the Long Running Operation.
296317
string last_denylist_import_operation = 8
297318
[(google.api.field_behavior) = OUTPUT_ONLY];
298319

299-
// Output only. The input config for the import of the source data that
300-
// contains the autocomplete allowlist phrases uploaded by the customer.
320+
// Output only. The source data for the latest import of the autocomplete
321+
// allowlist phrases.
301322
CompletionDataInputConfig allowlist_input_config = 9
302323
[(google.api.field_behavior) = OUTPUT_ONLY];
303324

304-
// Output only. LRO corresponding to the latest allowlist import.
325+
// Output only. Name of the LRO corresponding to the latest allowlist import.
305326
//
306327
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
307328
// retrieve the latest state of the Long Running Operation.

google/cloud/retail/v2beta/catalog_service.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ message UpdateCompletionConfigRequest {
384384
// method.
385385
message GetAttributesConfigRequest {
386386
// Required. Full AttributesConfig resource name. Format:
387-
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
387+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
388388
string name = 1 [
389389
(google.api.field_behavior) = REQUIRED,
390390
(google.api.resource_reference) = {
@@ -417,7 +417,7 @@ message UpdateAttributesConfigRequest {
417417
// method.
418418
message AddCatalogAttributeRequest {
419419
// Required. Full AttributesConfig resource name. Format:
420-
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
420+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
421421
string attributes_config = 1 [
422422
(google.api.field_behavior) = REQUIRED,
423423
(google.api.resource_reference) = {
@@ -436,7 +436,7 @@ message AddCatalogAttributeRequest {
436436
// method.
437437
message RemoveCatalogAttributeRequest {
438438
// Required. Full AttributesConfig resource name. Format:
439-
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
439+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
440440
string attributes_config = 1 [
441441
(google.api.field_behavior) = REQUIRED,
442442
(google.api.resource_reference) = {
@@ -454,7 +454,7 @@ message RemoveCatalogAttributeRequest {
454454
// method.
455455
message ReplaceCatalogAttributeRequest {
456456
// Required. Full AttributesConfig resource name. Format:
457-
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
457+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
458458
string attributes_config = 1 [
459459
(google.api.field_behavior) = REQUIRED,
460460
(google.api.resource_reference) = {

google/cloud/retail/v2beta/common.proto

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ option ruby_package = "Google::Cloud::Retail::V2beta";
3030

3131
// At which level we offer configuration for attributes.
3232
enum AttributeConfigLevel {
33-
// Value used when unset. Defaults to
33+
// Value used when unset. In this case, server behavior defaults to
3434
// [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2beta.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG].
3535
ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0;
3636

@@ -55,10 +55,24 @@ enum SolutionType {
5555
SOLUTION_TYPE_SEARCH = 2;
5656
}
5757

58+
// If filtering for recommendations is enabled.
59+
enum RecommendationsFilteringOption {
60+
// Value used when unset.
61+
// In this case, server behavior defaults to
62+
// [RECOMMENDATIONS_FILTERING_DISABLED][google.cloud.retail.v2beta.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED].
63+
RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0;
64+
65+
// Recommendation filtering is disabled.
66+
RECOMMENDATIONS_FILTERING_DISABLED = 1;
67+
68+
// Recommendation filtering is enabled.
69+
RECOMMENDATIONS_FILTERING_ENABLED = 3;
70+
}
71+
5872
// The use case of Cloud Retail Search.
5973
enum SearchSolutionUseCase {
60-
// The value when it's unspecified. Defaults to
61-
// [SEARCH][].
74+
// The value when it's unspecified. In this case, server behavior defaults to
75+
// [SEARCH_SOLUTION_USE_CASE_SEARCH][].
6276
SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0;
6377

6478
// Search use case. Expects the traffic has a non-empty
@@ -157,10 +171,13 @@ message Rule {
157171
}
158172

159173
// * Rule Condition:
160-
// - No [Condition][query_terms] provided is a global match.
161-
// - 1 or more [Condition][query_terms] provided is combined with OR
162-
// operator.
163-
// * Action Input: The request query and filter that will be applied to the
174+
// - No
175+
// [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms]
176+
// provided is a global match.
177+
// - 1 or more
178+
// [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms]
179+
// provided are combined with OR operator.
180+
// * Action Input: The request query and filter that are applied to the
164181
// retrieved products, in addition to any filters already provided with the
165182
// SearchRequest. The AND operator is used to combine the query's existing
166183
// filters with the filter rule(s). NOTE: May result in 0 results when
@@ -187,8 +204,10 @@ message Rule {
187204
}
188205

189206
// Redirects a shopper to a specific page.
207+
//
190208
// * Rule Condition:
191-
// - Must specify [Condition][query_terms].
209+
// - Must specify
210+
// [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms].
192211
// * Action Input: Request Query
193212
// * Action Result: Redirects shopper to provided uri.
194213
message RedirectAction {
@@ -388,25 +407,30 @@ message CustomAttribute {
388407
// set. Otherwise, an INVALID_ARGUMENT error is returned.
389408
repeated double numbers = 2;
390409

391-
// This field will only be used when
410+
// This field is normally ignored unless
392411
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
393-
// of the [Catalog][google.cloud.retail.v2beta.Catalog] is
394-
// 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
395-
// searchable by text queries in
412+
// of the [Catalog][google.cloud.retail.v2beta.Catalog] is set to the
413+
// deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about
414+
// product-level attribute configuration, see [Configuration
415+
// modes](https://cloud.google.com/retail/docs/attribute-config#config-modes).
416+
// If true, custom attribute values are searchable by text queries in
396417
// [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
397418
//
398419
// This field is ignored in a
399420
// [UserEvent][google.cloud.retail.v2beta.UserEvent].
400421
//
401422
// Only set if type [text][google.cloud.retail.v2beta.CustomAttribute.text] is
402423
// set. Otherwise, a INVALID_ARGUMENT error is returned.
403-
optional bool searchable = 3;
424+
optional bool searchable = 3 [deprecated = true];
404425

405-
// This field will only be used when
426+
// This field is normally ignored unless
406427
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level]
407-
// of the [Catalog][google.cloud.retail.v2beta.Catalog] is
408-
// 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
409-
// indexed, so that it can be filtered, faceted or boosted in
428+
// of the [Catalog][google.cloud.retail.v2beta.Catalog] is set to the
429+
// deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about
430+
// product-level attribute configuration, see [Configuration
431+
// modes](https://cloud.google.com/retail/docs/attribute-config#config-modes).
432+
// If true, custom attribute values are indexed, so that they can be filtered,
433+
// faceted or boosted in
410434
// [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search].
411435
//
412436
// This field is ignored in a
@@ -418,7 +442,7 @@ message CustomAttribute {
418442
// and
419443
// [SearchRequest.boost_spec][google.cloud.retail.v2beta.SearchRequest.boost_spec]
420444
// for more details.
421-
optional bool indexable = 4;
445+
optional bool indexable = 4 [deprecated = true];
422446
}
423447

424448
// Fulfillment information, such as the store IDs for in-store pickup or region
@@ -490,9 +514,8 @@ message Interval {
490514
// The lower bound of the interval. If neither of the min fields are set, then
491515
// the lower bound is negative infinity.
492516
//
493-
// This field must be not larger than
494-
// [max][google.cloud.retail.v2beta.Interval.max]. Otherwise, an
495-
// INVALID_ARGUMENT error is returned.
517+
// This field must not be larger than max.
518+
// Otherwise, an INVALID_ARGUMENT error is returned.
496519
oneof min {
497520
// Inclusive lower bound.
498521
double minimum = 1;
@@ -504,9 +527,8 @@ message Interval {
504527
// The upper bound of the interval. If neither of the max fields are set, then
505528
// the upper bound is positive infinity.
506529
//
507-
// This field must be not smaller than
508-
// [min][google.cloud.retail.v2beta.Interval.min]. Otherwise, an
509-
// INVALID_ARGUMENT error is returned.
530+
// This field must be not smaller than min.
531+
// Otherwise, an INVALID_ARGUMENT error is returned.
510532
oneof max {
511533
// Inclusive upper bound.
512534
double maximum = 3;
@@ -562,7 +584,11 @@ message PriceInfo {
562584
float price = 2;
563585

564586
// Price of the product without any discount. If zero, by default set to be
565-
// the [price][google.cloud.retail.v2beta.PriceInfo.price].
587+
// the [price][google.cloud.retail.v2beta.PriceInfo.price]. If set,
588+
// [original_price][google.cloud.retail.v2beta.PriceInfo.original_price]
589+
// should be greater than or equal to
590+
// [price][google.cloud.retail.v2beta.PriceInfo.price], otherwise an
591+
// INVALID_ARGUMENT error is thrown.
566592
float original_price = 3;
567593

568594
// The costs associated with the sale of a particular product. Used for gross
@@ -649,10 +675,14 @@ message Rating {
649675
// Information of an end user.
650676
message UserInfo {
651677
// Highly recommended for logged-in users. Unique identifier for logged-in
652-
// user, such as a user name.
678+
// user, such as a user name. Don't set for anonymous users.
653679
//
654680
// Always use a hashed value for this ID.
655681
//
682+
// Don't set the field to the same fixed ID for different users. This mixes
683+
// the event history of those users together, which results in degraded
684+
// model quality.
685+
//
656686
// The field must be a UTF-8 encoded string with a length limit of 128
657687
// characters. Otherwise, an INVALID_ARGUMENT error is returned.
658688
string user_id = 1;

0 commit comments

Comments
 (0)