Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 05005ea

Browse files
feat: allow users to disable spell check in search requests (#183)
* docs: fix docstring formatting Committer: parthea PiperOrigin-RevId: 449545643 Source-Link: googleapis/googleapis@1bed8a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d4ccc5fc612c260546bcecef2873575688a02d8b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDRjY2M1ZmM2MTJjMjYwNTQ2YmNlY2VmMjg3MzU3NTY4OGEwMmQ4YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: allow users to disable spell check in search requests feat: allow users to add labels in search requests docs: deprecate indexable/searchable on the product level custom attributes docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 452193046 Source-Link: googleapis/googleapis@4e0282f Source-Link: https://github.com/googleapis/googleapis-gen/commit/3fa3c84e3da8c8e604e129c141367dd0926878f3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2ZhM2M4NGUzZGE4YzhlNjA0ZTEyOWMxNDEzNjdkZDA5MjY4NzhmMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 809853f commit 05005ea

26 files changed

+884
-118
lines changed

protos/google/cloud/retail/v2/catalog.proto

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ message ProductLevelConfig {
4040
// default to
4141
// [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if
4242
// unset.
43-
// * `variant`: You can only ingest
44-
// [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
45-
// [Product][google.cloud.retail.v2.Product]s.
46-
// This means
43+
// * `variant` (incompatible with Retail Search): You can only
44+
// ingest
45+
// [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
46+
// [Product][google.cloud.retail.v2.Product]s. This means
4747
// [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id]
4848
// cannot be empty.
4949
//
@@ -54,8 +54,8 @@ message ProductLevelConfig {
5454
// [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field]
5555
// is `itemGroupId`, an INVALID_ARGUMENT error is returned.
5656
//
57-
// See [Using product
58-
// levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
57+
// See [Product
58+
// levels](https://cloud.google.com/retail/docs/catalog#product-levels)
5959
// for more details.
6060
string ingestion_product_type = 1;
6161

@@ -76,8 +76,8 @@ message ProductLevelConfig {
7676
// [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type]
7777
// is `variant`, an INVALID_ARGUMENT error is returned.
7878
//
79-
// See [Using product
80-
// levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
79+
// See [Product
80+
// levels](https://cloud.google.com/retail/docs/catalog#product-levels)
8181
// for more details.
8282
string merchant_center_product_id_field = 2;
8383
}

protos/google/cloud/retail/v2/common.proto

+24-12
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,29 @@ message CustomAttribute {
115115
// Otherwise, an INVALID_ARGUMENT error is returned.
116116
repeated double numbers = 2;
117117

118-
// This field will only be used when
118+
// This field is normally ignored unless
119119
// [AttributesConfig.attribute_config_level][] of the
120-
// [Catalog][google.cloud.retail.v2.Catalog] is
121-
// 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
122-
// searchable by text queries in
120+
// [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated
121+
// 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level
122+
// attribute configuration, see [Configuration
123+
// modes](https://cloud.google.com/retail/docs/attribute-config#config-modes).
124+
// If true, custom attribute values are searchable by text queries in
123125
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
124126
//
125127
// This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent].
126128
//
127129
// Only set if type [text][google.cloud.retail.v2.CustomAttribute.text] is
128130
// set. Otherwise, a INVALID_ARGUMENT error is returned.
129-
optional bool searchable = 3;
131+
optional bool searchable = 3 [deprecated = true];
130132

131-
// This field will only be used when
133+
// This field is normally ignored unless
132134
// [AttributesConfig.attribute_config_level][] of the
133-
// [Catalog][google.cloud.retail.v2.Catalog] is
134-
// 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG', if true, custom attribute values are
135-
// indexed, so that it can be filtered, faceted or boosted in
135+
// [Catalog][google.cloud.retail.v2.Catalog] is set to the deprecated
136+
// 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about product-level
137+
// attribute configuration, see [Configuration
138+
// modes](https://cloud.google.com/retail/docs/attribute-config#config-modes).
139+
// If true, custom attribute values are indexed, so that they can be filtered,
140+
// faceted or boosted in
136141
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
137142
//
138143
// This field is ignored in a [UserEvent][google.cloud.retail.v2.UserEvent].
@@ -142,7 +147,7 @@ message CustomAttribute {
142147
// and
143148
// [SearchRequest.boost_spec][google.cloud.retail.v2.SearchRequest.boost_spec]
144149
// for more details.
145-
optional bool indexable = 4;
150+
optional bool indexable = 4 [deprecated = true];
146151
}
147152

148153
// Fulfillment information, such as the store IDs for in-store pickup or region
@@ -284,7 +289,10 @@ message PriceInfo {
284289
float price = 2;
285290

286291
// Price of the product without any discount. If zero, by default set to be
287-
// the [price][google.cloud.retail.v2.PriceInfo.price].
292+
// the [price][google.cloud.retail.v2.PriceInfo.price]. If set,
293+
// [original_price][google.cloud.retail.v2.PriceInfo.original_price] should be
294+
// greater than or equal to [price][google.cloud.retail.v2.PriceInfo.price],
295+
// otherwise an INVALID_ARGUMENT error is thrown.
288296
float original_price = 3;
289297

290298
// The costs associated with the sale of a particular product. Used for gross
@@ -368,10 +376,14 @@ message Rating {
368376
// Information of an end user.
369377
message UserInfo {
370378
// Highly recommended for logged-in users. Unique identifier for logged-in
371-
// user, such as a user name.
379+
// user, such as a user name. Don't set for anonymous users.
372380
//
373381
// Always use a hashed value for this ID.
374382
//
383+
// Don't set the field to the same fixed ID for different users. This mixes
384+
// the event history of those users together, which results in degraded
385+
// model quality.
386+
//
375387
// The field must be a UTF-8 encoded string with a length limit of 128
376388
// characters. Otherwise, an INVALID_ARGUMENT error is returned.
377389
string user_id = 1;

protos/google/cloud/retail/v2/completion_service.proto

+11-4
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ message CompleteQueryRequest {
133133
//
134134
// * user-data
135135
//
136-
// * cloud-retail
137-
// This option requires additional allowlisting. Before using cloud-retail,
138-
// contact Cloud Retail support team first.
136+
// * cloud-retail:
137+
// This option requires enabling auto-learning function first. See
138+
// [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).
139139
string dataset = 6;
140140

141141
// Completion max suggestions. If left unset or set to 0, then will fallback
@@ -154,10 +154,13 @@ message CompleteQueryResponse {
154154
string suggestion = 1;
155155

156156
// Custom attributes for the suggestion term.
157+
//
157158
// * For "user-data", the attributes are additional custom attributes
158159
// ingested through BigQuery.
160+
//
159161
// * For "cloud-retail", the attributes are product attributes generated
160-
// by Cloud Retail.
162+
// by Cloud Retail. This is an experimental feature. Contact Retail Search
163+
// support team if you are interested in enabling it.
161164
map<string, CustomAttribute> attributes = 2;
162165
}
163166

@@ -185,11 +188,15 @@ message CompleteQueryResponse {
185188
// [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id]
186189
// field is set and [UserEvent][google.cloud.retail.v2.UserEvent] is imported.
187190
// The recent searches satisfy the follow rules:
191+
//
188192
// * They are ordered from latest to oldest.
193+
//
189194
// * They are matched with
190195
// [CompleteQueryRequest.query][google.cloud.retail.v2.CompleteQueryRequest.query]
191196
// case insensitively.
197+
//
192198
// * They are transformed to lower cases.
199+
//
193200
// * They are UTF-8 safe.
194201
//
195202
// Recent searches are deduplicated. More recent searches will be reserved

protos/google/cloud/retail/v2/import_config.proto

+9-2
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,18 @@ message ImportProductsRequest {
214214
// [ReconciliationMode.INCREMENTAL][google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode.INCREMENTAL].
215215
ReconciliationMode reconciliation_mode = 5;
216216

217-
// Pub/Sub topic for receiving notification. If this field is set,
217+
// Full Pub/Sub topic name for receiving notification. If this field is set,
218218
// when the import is finished, a notification will be sent to
219219
// specified Pub/Sub topic. The message data will be JSON string of a
220220
// [Operation][google.longrunning.Operation].
221-
// Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
221+
//
222+
// Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
223+
// to be within the same project as
224+
// [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent].
225+
// Make sure that both
226+
227+
// `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
228+
// have the `pubsub.topics.publish` IAM permission on the topic.
222229
//
223230
// Only supported when
224231
// [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode]

protos/google/cloud/retail/v2/prediction_service.proto

+13-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ message PredictRequest {
6363
// they took to trigger the predict request. Note that this user event detail
6464
// won't be ingested to userEvent logs. Thus, a separate userEvent write
6565
// request is required for event logging.
66+
//
67+
// Don't set
68+
// [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] or
69+
// [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] to the same
70+
// fixed ID for different users. If you are trying to receive non-personalized
71+
// recommendations (not recommended; this can negatively impact model
72+
// performance), instead set
73+
// [UserEvent.visitor_id][google.cloud.retail.v2.UserEvent.visitor_id] to a
74+
// random unique ID and leave
75+
// [UserInfo.user_id][google.cloud.retail.v2.UserInfo.user_id] unset.
6676
UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED];
6777

6878
// Maximum number of results to return per page. Set this property
@@ -143,7 +153,7 @@ message PredictRequest {
143153
// * Each resource can have multiple labels, up to a maximum of 64.
144154
// * Each label must be a key-value pair.
145155
// * Keys have a minimum length of 1 character and a maximum length of 63
146-
// characters, and cannot be empty. Values can be empty, and have a maximum
156+
// characters and cannot be empty. Values can be empty and have a maximum
147157
// length of 63 characters.
148158
// * Keys and values can contain only lowercase letters, numeric characters,
149159
// underscores, and dashes. All characters must use UTF-8 encoding, and
@@ -169,9 +179,9 @@ message PredictResponse {
169179
//
170180
// Possible values:
171181
//
172-
// * `product`: JSON representation of the product. Will be set if
182+
// * `product`: JSON representation of the product. Is set if
173183
// `returnProduct` is set to true in `PredictRequest.params`.
174-
// * `score`: Prediction score in double value. Will be set if
184+
// * `score`: Prediction score in double value. Is set if
175185
// `returnScore` is set to true in `PredictRequest.params`.
176186
map<string, google.protobuf.Value> metadata = 2;
177187
}

protos/google/cloud/retail/v2/product.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,11 @@ message Product {
536536
// * [name][google.cloud.retail.v2.Product.name]
537537
// * [color_info][google.cloud.retail.v2.Product.color_info]
538538
//
539-
// Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
539+
// The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
540540
// returned.
541541
//
542542
// Note: Returning more fields in
543-
// [SearchResponse][google.cloud.retail.v2.SearchResponse] may increase
543+
// [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase
544544
// response payload size and serving latency.
545545
google.protobuf.FieldMask retrievable_fields = 30;
546546

protos/google/cloud/retail/v2/product_service.proto

+26-10
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ service ProductService {
8888

8989
// Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.
9090
//
91-
// Request processing may be synchronous. No partial updating is supported.
91+
// Request processing may be synchronous.
9292
// Non-existing items are created.
9393
//
9494
// Note that it is possible for a subset of the
@@ -139,7 +139,7 @@ service ProductService {
139139
//
140140
// Pre-existing inventory information can only be updated with
141141
// [SetInventory][google.cloud.retail.v2.ProductService.SetInventory],
142-
// [AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces],
142+
// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces],
143143
// and
144144
// [RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].
145145
//
@@ -345,6 +345,11 @@ message UpdateProductRequest {
345345
//
346346
// If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
347347
// is returned.
348+
//
349+
// The attribute key can be updated by setting the mask path as
350+
// "attributes.${key_name}". If a key name is present in the mask but not in
351+
// the patching product from the request, this key will be deleted after the
352+
// update.
348353
google.protobuf.FieldMask update_mask = 2;
349354

350355
// If set to true, and the [Product][google.cloud.retail.v2.Product] is not
@@ -572,7 +577,9 @@ message SetInventoryMetadata {}
572577
// method.
573578
message SetInventoryResponse {}
574579

575-
// Request message for [AddFulfillmentPlaces][] method.
580+
// Request message for
581+
// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
582+
// method.
576583
message AddFulfillmentPlacesRequest {
577584
// Required. Full resource name of [Product][google.cloud.retail.v2.Product],
578585
// such as
@@ -640,15 +647,19 @@ message AddFulfillmentPlacesRequest {
640647

641648
// Metadata related to the progress of the AddFulfillmentPlaces operation.
642649
// Currently empty because there is no meaningful metadata populated from the
643-
// [AddFulfillmentPlaces][] method.
650+
// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
651+
// method.
644652
message AddFulfillmentPlacesMetadata {}
645653

646654
// Response of the AddFulfillmentPlacesRequest. Currently empty because
647-
// there is no meaningful response populated from the [AddFulfillmentPlaces][]
655+
// there is no meaningful response populated from the
656+
// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
648657
// method.
649658
message AddFulfillmentPlacesResponse {}
650659

651-
// Request message for [AddLocalInventories][] method.
660+
// Request message for
661+
// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
662+
// method.
652663
message AddLocalInventoriesRequest {
653664
// Required. Full resource name of [Product][google.cloud.retail.v2.Product],
654665
// such as
@@ -700,11 +711,15 @@ message AddLocalInventoriesRequest {
700711

701712
// Metadata related to the progress of the AddLocalInventories operation.
702713
// Currently empty because there is no meaningful metadata populated from the
703-
// [AddLocalInventories][] method.
714+
// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
715+
// method.
704716
message AddLocalInventoriesMetadata {}
705717

706-
// Response of the [AddLocalInventories][] API. Currently empty because
707-
// there is no meaningful response populated from the [AddLocalInventories][]
718+
// Response of the
719+
// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
720+
// API. Currently empty because there is no meaningful response populated from
721+
// the
722+
// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
708723
// method.
709724
message AddLocalInventoriesResponse {}
710725

@@ -782,7 +797,8 @@ message RemoveFulfillmentPlacesRequest {
782797
// If this field is set to an invalid value other than these, an
783798
// INVALID_ARGUMENT error is returned.
784799
//
785-
// This field directly corresponds to [Product.fulfillment_info.type][].
800+
// This field directly corresponds to
801+
// [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type].
786802
string type = 2 [(google.api.field_behavior) = REQUIRED];
787803

788804
// Required. The IDs for this

protos/google/cloud/retail/v2/purge_config.proto

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ message PurgeUserEventsRequest {
3737
// Required. The resource name of the catalog under which the events are
3838
// created. The format is
3939
// `projects/${projectId}/locations/global/catalogs/${catalogId}`
40-
string parent = 1 [(google.api.field_behavior) = REQUIRED];
40+
string parent = 1 [
41+
(google.api.field_behavior) = REQUIRED,
42+
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
43+
];
4144

4245
// Required. The filter string to specify the events to be deleted with a
4346
// length limit of 5,000 characters. Empty string filter is not allowed. The

0 commit comments

Comments
 (0)