@google-cloud/discoveryengine 0.4.1 → 0.6.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 (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -0
  3. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +43 -10
  4. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +116 -0
  5. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +45 -3
  6. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +46 -12
  7. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +26 -8
  8. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +86 -0
  9. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +15 -14
  10. package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +58 -0
  11. package/build/protos/google/cloud/discoveryengine/v1beta/schema_service.proto +259 -0
  12. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +546 -0
  13. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +31 -25
  14. package/build/protos/protos.d.ts +5965 -1866
  15. package/build/protos/protos.js +39781 -1
  16. package/build/protos/protos.json +3963 -1
  17. package/build/src/index.d.ts +10 -1
  18. package/build/src/index.js +10 -1
  19. package/build/src/v1beta/completion_service_client.d.ts +455 -0
  20. package/build/src/v1beta/completion_service_client.js +659 -0
  21. package/build/src/v1beta/completion_service_client_config.json +43 -0
  22. package/build/src/v1beta/document_service_client.d.ts +174 -18
  23. package/build/src/v1beta/document_service_client.js +177 -6
  24. package/build/src/v1beta/document_service_client_config.json +5 -0
  25. package/build/src/v1beta/index.d.ts +3 -0
  26. package/build/src/v1beta/index.js +7 -1
  27. package/build/src/v1beta/recommendation_service_client.d.ts +108 -14
  28. package/build/src/v1beta/recommendation_service_client.js +128 -0
  29. package/build/src/v1beta/schema_service_client.d.ts +798 -0
  30. package/build/src/v1beta/schema_service_client.js +1122 -0
  31. package/build/src/v1beta/schema_service_client_config.json +63 -0
  32. package/build/src/v1beta/search_service_client.d.ts +851 -0
  33. package/build/src/v1beta/search_service_client.js +1070 -0
  34. package/build/src/v1beta/search_service_client_config.json +43 -0
  35. package/build/src/v1beta/user_event_service_client.d.ts +93 -0
  36. package/build/src/v1beta/user_event_service_client.js +128 -0
  37. package/package.json +8 -6
@@ -0,0 +1,546 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1beta;
18
+
19
+ import "google/api/annotations.proto";
20
+ import "google/api/client.proto";
21
+ import "google/api/field_behavior.proto";
22
+ import "google/api/resource.proto";
23
+ import "google/cloud/discoveryengine/v1beta/common.proto";
24
+ import "google/cloud/discoveryengine/v1beta/document.proto";
25
+ import "google/protobuf/struct.proto";
26
+
27
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
28
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
29
+ option java_multiple_files = true;
30
+ option java_outer_classname = "SearchServiceProto";
31
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
32
+ option objc_class_prefix = "DISCOVERYENGINE";
33
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
34
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
35
+
36
+ // Service for search.
37
+ service SearchService {
38
+ option (google.api.default_host) = "discoveryengine.googleapis.com";
39
+ option (google.api.oauth_scopes) =
40
+ "https://www.googleapis.com/auth/cloud-platform";
41
+
42
+ // Performs a search.
43
+ rpc Search(SearchRequest) returns (SearchResponse) {
44
+ option (google.api.http) = {
45
+ post: "/v1beta/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search"
46
+ body: "*"
47
+ additional_bindings {
48
+ post: "/v1beta/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search"
49
+ body: "*"
50
+ }
51
+ };
52
+ }
53
+ }
54
+
55
+ // Request message for
56
+ // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
57
+ // method.
58
+ message SearchRequest {
59
+ // A facet specification to perform faceted search.
60
+ message FacetSpec {
61
+ // Specifies how a facet is computed.
62
+ message FacetKey {
63
+ // Required. Supported textual and numerical facet keys in
64
+ // [Document][google.cloud.discoveryengine.v1beta.Document] object, over
65
+ // which the facet values are computed. Facet key is case-sensitive.
66
+ string key = 1 [(google.api.field_behavior) = REQUIRED];
67
+
68
+ // Set only if values should be bucketized into intervals. Must be set
69
+ // for facets with numerical values. Must not be set for facet with text
70
+ // values. Maximum number of intervals is 30.
71
+ repeated Interval intervals = 2;
72
+
73
+ // Only get facet for the given restricted values. Only supported on
74
+ // textual fields. For example, suppose "category" has three values
75
+ // "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
76
+ // "restricted_values" to "Action > 2022", the "category" facet will only
77
+ // contain "Action > 2022". Only supported on textual fields. Maximum
78
+ // is 10.
79
+ repeated string restricted_values = 3;
80
+
81
+ // Only get facet values that start with the given string prefix. For
82
+ // example, suppose "category" has three values "Action > 2022",
83
+ // "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
84
+ // "category" facet will only contain "Action > 2022" and "Action > 2021".
85
+ // Only supported on textual fields. Maximum is 10.
86
+ repeated string prefixes = 4;
87
+
88
+ // Only get facet values that contains the given strings. For example,
89
+ // suppose "category" has three values "Action > 2022",
90
+ // "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
91
+ // "category" facet will only contain "Action > 2022" and "Sci-Fi > 2022".
92
+ // Only supported on textual fields. Maximum is 10.
93
+ repeated string contains = 5;
94
+
95
+ // True to make facet keys case insensitive when getting faceting
96
+ // values with prefixes or contains; false otherwise.
97
+ bool case_insensitive = 6;
98
+
99
+ // The order in which documents are returned.
100
+ //
101
+ // Allowed values are:
102
+ //
103
+ // * "count desc", which means order by
104
+ // [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
105
+ // descending.
106
+ //
107
+ // * "value desc", which means order by
108
+ // [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.value]
109
+ // descending.
110
+ // Only applies to textual facets.
111
+ //
112
+ // If not set, textual values are sorted in [natural
113
+ // order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
114
+ // intervals are sorted in the order given by
115
+ // [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
116
+ string order_by = 7;
117
+ }
118
+
119
+ // Required. The facet key specification.
120
+ FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED];
121
+
122
+ // Maximum of facet values that should be returned for this facet. If
123
+ // unspecified, defaults to 20. The maximum allowed value is 300. Values
124
+ // above 300 will be coerced to 300.
125
+ //
126
+ // If this field is negative, an `INVALID_ARGUMENT` is returned.
127
+ int32 limit = 2;
128
+
129
+ // List of keys to exclude when faceting.
130
+ //
131
+ //
132
+ // By default,
133
+ // [FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key]
134
+ // is not excluded from the filter unless it is listed in this field.
135
+ //
136
+ // Listing a facet key in this field allows its values to appear as facet
137
+ // results, even when they are filtered out of search results. Using this
138
+ // field does not affect what search results are returned.
139
+ //
140
+ // For example, suppose there are 100 documents with the color facet "Red"
141
+ // and 200 documents with the color facet "Blue". A query containing the
142
+ // filter "color:ANY("Red")" and having "color" as
143
+ // [FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key]
144
+ // would by default return only "Red" documents in the search results, and
145
+ // also return "Red" with count 100 as the only color facet. Although there
146
+ // are also blue documents available, "Blue" would not be shown as an
147
+ // available facet value.
148
+ //
149
+ // If "color" is listed in "excludedFilterKeys", then the query returns the
150
+ // facet values "Red" with count 100 and "Blue" with count 200, because the
151
+ // "color" key is now excluded from the filter. Because this field doesn't
152
+ // affect search results, the search results are still correctly filtered to
153
+ // return only "Red" documents.
154
+ //
155
+ // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
156
+ // error is returned.
157
+ repeated string excluded_filter_keys = 3;
158
+
159
+ // Enables dynamic position for this facet. If set to true, the position of
160
+ // this facet among all facets in the response is determined automatically.
161
+ // It will be ordered together with dynamic facets if dynamic
162
+ // facets is enabled. If set to false, the position of this facet in the
163
+ // response will be the same as in the request, and it will be ranked before
164
+ // the facets with dynamic position enable and all dynamic facets.
165
+ //
166
+ // For example, you may always want to have rating facet returned in
167
+ // the response, but it's not necessarily to always display the rating facet
168
+ // at the top. In that case, you can set enable_dynamic_position to true so
169
+ // that the position of rating facet in response will be determined
170
+ // automatically.
171
+ //
172
+ // Another example, assuming you have the following facets in the request:
173
+ //
174
+ // * "rating", enable_dynamic_position = true
175
+ //
176
+ // * "price", enable_dynamic_position = false
177
+ //
178
+ // * "brands", enable_dynamic_position = false
179
+ //
180
+ // And also you have a dynamic facets enable, which will generate a facet
181
+ // 'gender'. Then the final order of the facets in the response can be
182
+ // ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
183
+ // "rating") depends on how API orders "gender" and "rating" facets.
184
+ // However, notice that "price" and "brands" will always be
185
+ // ranked at 1st and 2nd position since their enable_dynamic_position are
186
+ // false.
187
+ bool enable_dynamic_position = 4;
188
+ }
189
+
190
+ // Boost specification to boost certain documents.
191
+ message BoostSpec {
192
+ // Boost applies to documents which match a condition.
193
+ message ConditionBoostSpec {
194
+ // An expression which specifies a boost condition. The syntax and
195
+ // supported fields are the same as a filter expression. See
196
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1beta.SearchRequest.filter]
197
+ // for detail syntax and limitations.
198
+ //
199
+ // Examples:
200
+ //
201
+ // * To boost documents with document ID "doc_1" or "doc_2", and
202
+ // color
203
+ // "Red" or "Blue":
204
+ // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
205
+ string condition = 1;
206
+
207
+ // Strength of the condition boost, which should be in [-1, 1]. Negative
208
+ // boost means demotion. Default is 0.0.
209
+ //
210
+ // Setting to 1.0 gives the document a big promotion. However, it does not
211
+ // necessarily mean that the boosted document will be the top result at
212
+ // all times, nor that other documents will be excluded. Results could
213
+ // still be shown even when none of them matches the condition. And
214
+ // results that are significantly more relevant to the search query can
215
+ // still trump your heavily favored but irrelevant documents.
216
+ //
217
+ // Setting to -1.0 gives the document a big demotion. However, results
218
+ // that are deeply relevant might still be shown. The document will have
219
+ // an upstream battle to get a fairly high ranking, but it is not blocked
220
+ // out completely.
221
+ //
222
+ // Setting to 0.0 means no boost applied. The boosting condition is
223
+ // ignored.
224
+ float boost = 2;
225
+ }
226
+
227
+ // Condition boost specifications. If a document matches multiple conditions
228
+ // in the specifictions, boost scores from these specifications are all
229
+ // applied and combined in a non-linear way. Maximum number of
230
+ // specifications is 20.
231
+ repeated ConditionBoostSpec condition_boost_specs = 1;
232
+ }
233
+
234
+ // Specification to determine under which conditions query expansion should
235
+ // occur.
236
+ message QueryExpansionSpec {
237
+ // Enum describing under which condition query expansion should occur.
238
+ enum Condition {
239
+ // Unspecified query expansion condition. In this case, server behavior
240
+ // defaults to
241
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
242
+ CONDITION_UNSPECIFIED = 0;
243
+
244
+ // Disabled query expansion. Only the exact search query is used, even if
245
+ // [SearchResponse.total_size][google.cloud.discoveryengine.v1beta.SearchResponse.total_size]
246
+ // is zero.
247
+ DISABLED = 1;
248
+
249
+ // Automatic query expansion built by the Search API.
250
+ AUTO = 2;
251
+ }
252
+
253
+ // The condition under which query expansion should occur. Default to
254
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
255
+ Condition condition = 1;
256
+ }
257
+
258
+ // The specification for query spell correction.
259
+ message SpellCorrectionSpec {
260
+ // Enum describing under which mode spell correction should occur.
261
+ enum Mode {
262
+ // Unspecified spell correction mode. In this case, server behavior
263
+ // defaults to
264
+ // [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
265
+ MODE_UNSPECIFIED = 0;
266
+
267
+ // Search API will try to find a spell suggestion if there
268
+ // is any and put in the
269
+ // [SearchResponse.corrected_query][google.cloud.discoveryengine.v1beta.SearchResponse.corrected_query].
270
+ // The spell suggestion will not be used as the search query.
271
+ SUGGESTION_ONLY = 1;
272
+
273
+ // Automatic spell correction built by the Search API. Search will
274
+ // be based on the corrected query if found.
275
+ AUTO = 2;
276
+ }
277
+
278
+ // The mode under which spell correction should take effect to
279
+ // replace the original search query. Default to
280
+ // [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
281
+ Mode mode = 1;
282
+ }
283
+
284
+ // The specification that configs the desired behavior of the UCS content
285
+ // search.
286
+ message ContentSearchSpec {
287
+ // The specification that configs the snippet in the search results.
288
+ message SnippetSpec {
289
+ // Max number of snippets returned in each search result.
290
+ // If the matching snippets is less than the max_snippet_count, return all
291
+ // of the snippets; otherwise, return the max_snippet_count.
292
+ //
293
+ // At most 5 snippets will be returned for each SearchResult.
294
+ int32 max_snippet_count = 1;
295
+
296
+ // if true, only snippet reference is returned.
297
+ bool reference_only = 2;
298
+ }
299
+
300
+ // The specification that configs the summary in the search response.
301
+ message SummarySpec {
302
+ // The number of top results the summary should be generated from.
303
+ // If the number of returned results is less than summary_result_count,
304
+ // then the summary would be derived from all the results; otherwise, the
305
+ // summary would be derived from the top results.
306
+ //
307
+ // At most 5 results can be used for generating summary.
308
+ int32 summary_result_count = 1;
309
+ }
310
+
311
+ // If there is no snippet spec provided, there will be no snippet in the
312
+ // search result.
313
+ SnippetSpec snippet_spec = 1;
314
+
315
+ // If there is no summary spec provided, there will be no summary in the
316
+ // search response.
317
+ SummarySpec summary_spec = 2;
318
+ }
319
+
320
+ // Required. The resource name of the Search serving config, such as
321
+ // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
322
+ // This field is used to identify the serving configuration name, set
323
+ // of models used to make the search.
324
+ string serving_config = 1 [
325
+ (google.api.field_behavior) = REQUIRED,
326
+ (google.api.resource_reference) = {
327
+ type: "discoveryengine.googleapis.com/ServingConfig"
328
+ }
329
+ ];
330
+
331
+ // The branch resource name, such as
332
+ // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
333
+ //
334
+ // Use `default_branch` as the branch ID or leave this field empty, to search
335
+ // documents under the default branch.
336
+ string branch = 2 [(google.api.resource_reference) = {
337
+ type: "discoveryengine.googleapis.com/Branch"
338
+ }];
339
+
340
+ // Raw search query.
341
+ string query = 3;
342
+
343
+ // Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s
344
+ // to return. If unspecified, defaults to a reasonable value. The maximum
345
+ // allowed value is 100. Values above 100 will be coerced to 100.
346
+ //
347
+ // If this field is negative, an `INVALID_ARGUMENT` is returned.
348
+ int32 page_size = 4;
349
+
350
+ // A page token received from a previous
351
+ // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
352
+ // call. Provide this to retrieve the subsequent page.
353
+ //
354
+ // When paginating, all other parameters provided to
355
+ // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
356
+ // must match the call that provided the page token. Otherwise, an
357
+ // `INVALID_ARGUMENT` error is returned.
358
+ string page_token = 5;
359
+
360
+ // A 0-indexed integer that specifies the current offset (that is, starting
361
+ // result location, amongst the
362
+ // [Document][google.cloud.discoveryengine.v1beta.Document]s deemed by the API
363
+ // as relevant) in search results. This field is only considered if
364
+ // [page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
365
+ // is unset.
366
+ //
367
+ // If this field is negative, an `INVALID_ARGUMENT` is returned.
368
+ int32 offset = 6;
369
+
370
+ // The filter syntax consists of an expression language for constructing a
371
+ // predicate from one or more fields of the documents being filtered. Filter
372
+ // expression is case-sensitive.
373
+ //
374
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
375
+ string filter = 7;
376
+
377
+ // The order in which documents are returned. Document can be ordered by
378
+ // a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
379
+ // object. Leave it unset if ordered by relevance. OrderBy expression is
380
+ // case-sensitive.
381
+ //
382
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
383
+ string order_by = 8;
384
+
385
+ // Facet specifications for faceted search. If empty, no facets are returned.
386
+ //
387
+ // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
388
+ // error is returned.
389
+ repeated FacetSpec facet_specs = 9;
390
+
391
+ // Boost specification to boost certain documents.
392
+ BoostSpec boost_spec = 10;
393
+
394
+ // Additional search parameters.
395
+ //
396
+ // For
397
+ // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
398
+ // vertical, supported values are:
399
+ //
400
+ // * `user_country_code`: string. Default empty. If set to non-empty, results
401
+ // are restricted or boosted based on the location provided.
402
+ // * `search_type`: double. Default empty. Enables non-webpage searching
403
+ // depending on the value. The only valid non-default value is 1,
404
+ // which enables image searching.
405
+ // This field is ignored for other verticals.
406
+ map<string, google.protobuf.Value> params = 11;
407
+
408
+ // The query expansion specification that specifies the conditions under which
409
+ // query expansion will occur.
410
+ QueryExpansionSpec query_expansion_spec = 13;
411
+
412
+ // The spell correction specification that specifies the mode under
413
+ // which spell correction will take effect.
414
+ SpellCorrectionSpec spell_correction_spec = 14;
415
+
416
+ // A unique identifier for tracking visitors. For example, this could be
417
+ // implemented with an HTTP cookie, which should be able to uniquely identify
418
+ // a visitor on a single device. This unique identifier should not change if
419
+ // the visitor logs in or out of the website.
420
+ //
421
+ // This field should NOT have a fixed value such as `unknown_visitor`.
422
+ //
423
+ // This should be the same identifier as
424
+ // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id]
425
+ // and
426
+ // [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.CompleteQueryRequest.user_pseudo_id]
427
+ //
428
+ // The field must be a UTF-8 encoded string with a length limit of 128
429
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
430
+ string user_pseudo_id = 15;
431
+
432
+ // The content search spec that configs the desired behavior of content
433
+ // search.
434
+ ContentSearchSpec content_search_spec = 24;
435
+ }
436
+
437
+ // Response message for
438
+ // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
439
+ // method.
440
+ message SearchResponse {
441
+ // Represents the search results.
442
+ message SearchResult {
443
+ // [Document.id][google.cloud.discoveryengine.v1beta.Document.id] of the
444
+ // searched [Document][google.cloud.discoveryengine.v1beta.Document].
445
+ string id = 1;
446
+
447
+ // The document data snippet in the search response. Only fields that are
448
+ // marked as retrievable are populated.
449
+ Document document = 2;
450
+ }
451
+
452
+ // A facet result.
453
+ message Facet {
454
+ // A facet value which contains value names and their count.
455
+ message FacetValue {
456
+ // A facet value which contains values.
457
+ oneof facet_value {
458
+ // Text value of a facet, such as "Black" for facet "colors".
459
+ string value = 1;
460
+
461
+ // Interval value for a facet, such as [10, 20) for facet "price". It
462
+ // matches
463
+ // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
464
+ Interval interval = 2;
465
+ }
466
+
467
+ // Number of items that have this facet value.
468
+ int64 count = 3;
469
+ }
470
+
471
+ // The key for this facet. E.g., "colors" or "price". It matches
472
+ // [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.key].
473
+ string key = 1;
474
+
475
+ // The facet values for this field.
476
+ repeated FacetValue values = 2;
477
+
478
+ // Whether the facet is dynamically generated.
479
+ bool dynamic_facet = 3;
480
+ }
481
+
482
+ // Guided search result. The guided search helps user to refine the search
483
+ // results and narrow down to the real needs from a broaded search results.
484
+ message GuidedSearchResult {
485
+ // Useful attribute for search result refinements.
486
+ message RefinementAttribute {
487
+ // Attribute key used to refine the results e.g. 'movie_type'.
488
+ string attribute_key = 1;
489
+
490
+ // Attribute value used to refine the results e.g. 'drama'.
491
+ string attribute_value = 2;
492
+ }
493
+
494
+ // A list of ranked refinement attributes.
495
+ repeated RefinementAttribute refinement_attributes = 1;
496
+ }
497
+
498
+ // Summary of the top N search result specified by the summary spec.
499
+ message Summary {
500
+ // The summary content.
501
+ string summary_text = 1;
502
+ }
503
+
504
+ // A list of matched documents. The order represents the ranking.
505
+ repeated SearchResult results = 1;
506
+
507
+ // Results of facets requested by user.
508
+ repeated Facet facets = 2;
509
+
510
+ // Guided search result.
511
+ GuidedSearchResult guided_search_result = 8;
512
+
513
+ // The estimated total count of matched items irrespective of pagination. The
514
+ // count of
515
+ // [results][google.cloud.discoveryengine.v1beta.SearchResponse.results]
516
+ // returned by pagination may be less than the
517
+ // [total_size][google.cloud.discoveryengine.v1beta.SearchResponse.total_size]
518
+ // that matches.
519
+ int32 total_size = 3;
520
+
521
+ // A unique search token. This should be included in the
522
+ // [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] logs resulting
523
+ // from this search, which enables accurate attribution of search model
524
+ // performance.
525
+ string attribution_token = 4;
526
+
527
+ // A token that can be sent as
528
+ // [SearchRequest.page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
529
+ // to retrieve the next page. If this field is omitted, there are no
530
+ // subsequent pages.
531
+ string next_page_token = 5;
532
+
533
+ // Contains the spell corrected query, if found. If the spell correction type
534
+ // is AUTOMATIC, then the search results are based on corrected_query.
535
+ // Otherwise the original query is used for search.
536
+ string corrected_query = 7;
537
+
538
+ // A summary as part of the search results.
539
+ // This field is only returned if
540
+ // [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.summary_spec]
541
+ // is set.
542
+ Summary summary = 9;
543
+
544
+ // Controls applied as part of the Control service.
545
+ repeated string applied_controls = 10;
546
+ }
@@ -114,17 +114,19 @@ message UserEvent {
114
114
  // Token to attribute an API response to user action(s) to trigger the event.
115
115
  //
116
116
  // Highly recommended for user events that are the result of
117
- // [PredictionService.Predict][]. This field enables accurate attribution of
118
- // recommendation model performance.
117
+ // [RecommendationService.Recommend][google.cloud.discoveryengine.v1beta.RecommendationService.Recommend].
118
+ // This field enables accurate attribution of recommendation model
119
+ // performance.
119
120
  //
120
121
  // The value must be one of:
121
122
  //
122
123
  // * [PredictResponse.attribution_token][] for events that are the result of
123
- // [PredictionService.Predict][].
124
+ // [RecommendationService.Recommend][google.cloud.discoveryengine.v1beta.RecommendationService.Recommend].
124
125
  // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1beta.SearchResponse.attribution_token] for events that are the result of
125
- // [SearchService.Search][].
126
+ // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search].
126
127
  // * [CompleteQueryResponse.attribution_token][] for events that are the
127
- // result of [SearchService.CompleteQuery][].
128
+ // result of
129
+ // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.CompleteQuery].
128
130
  //
129
131
  // This token enables us to accurately attribute page view or conversion
130
132
  // completion back to the event and the particular predict response containing
@@ -138,14 +140,15 @@ message UserEvent {
138
140
  // predicate from one or more fields of the documents being filtered.
139
141
  //
140
142
  // One example is for `search` events, the associated
141
- // [SearchService.SearchRequest][] may contain a filter expression in
142
- // [SearchService.SearchRequest.filter][] conforming to
143
- // https://google.aip.dev/160#filtering.
143
+ // [SearchRequest][google.cloud.discoveryengine.v1beta.SearchRequest] may
144
+ // contain a filter expression in
145
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1beta.SearchRequest.filter]
146
+ // conforming to https://google.aip.dev/160#filtering.
144
147
  //
145
148
  // Similarly, for `view-item-list` events that are generated from a
146
- // [PredictionService.PredictRequest][], this field may be populated directly
147
- // from [PredictionService.PredictRequest.filter][] conforming to
148
- // https://google.aip.dev/160#filtering.
149
+ // [RecommendationService.RecommendRequest][], this field may be populated
150
+ // directly from [RecommendationService.RecommendRequest.filter][] conforming
151
+ // to https://google.aip.dev/160#filtering.
149
152
  //
150
153
  // The value must be a UTF-8 encoded string with a length limit of 1,000
151
154
  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
@@ -207,8 +210,8 @@ message UserEvent {
207
210
  // those custom attributes when training models and serving predictions, which
208
211
  // helps improve recommendation quality.
209
212
  //
210
- // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
211
- // error is returned:
213
+ // This field needs to pass all below criteria, otherwise an
214
+ // `INVALID_ARGUMENT` error is returned:
212
215
  //
213
216
  // * The key must be a UTF-8 encoded string with a length limit of 5,000
214
217
  // characters.
@@ -218,7 +221,8 @@ message UserEvent {
218
221
  // * For number attributes, at most 400 values are allowed.
219
222
  //
220
223
  // For product recommendations, an example of extra user information is
221
- // traffic_channel, which is how a user arrives at the site. Users can arrive
224
+ // ` traffic_channel`, which is how a user arrives at the site. Users can
225
+ // arrive
222
226
  // at the site by coming to the site directly, coming through Google
223
227
  // search, or in other ways.
224
228
  map<string, CustomAttribute> attributes = 17;
@@ -283,9 +287,10 @@ message SearchInfo {
283
287
  //
284
288
  // At least one of
285
289
  // [search_query][google.cloud.discoveryengine.v1beta.SearchInfo.search_query]
286
- // or [page_categories][] is required for `search` events. Other event types
287
- // should not set this field. Otherwise, an INVALID_ARGUMENT error is
288
- // returned.
290
+ // or
291
+ // [PageInfo.page_category][google.cloud.discoveryengine.v1beta.PageInfo.page_category]
292
+ // is required for `search` events. Other event types should not set this
293
+ // field. Otherwise, an INVALID_ARGUMENT error is returned.
289
294
  string search_query = 1;
290
295
 
291
296
  // The order in which products are returned, if applicable.
@@ -378,23 +383,24 @@ message TransactionInfo {
378
383
 
379
384
  // Detailed document information associated with a user event.
380
385
  message DocumentInfo {
381
- // A required descriptor of the associated Document.
386
+ // A required descriptor of the associated
387
+ // [Document][google.cloud.discoveryengine.v1beta.Document].
382
388
  //
383
389
  // * If [id][google.cloud.discoveryengine.v1beta.DocumentInfo.id] is
384
- // specified, then the default values for {location}, {collection_id},
385
- // {data_store_id}, and {branch_id} are used when annotating with the stored
386
- // Document.
390
+ // specified, then the default values for
391
+ // `{location}`, `{collection_id}`, `{data_store_id}`, and `{branch_id}` are
392
+ // used when annotating with the stored Document.
387
393
  //
388
394
  // * If [name][google.cloud.discoveryengine.v1beta.DocumentInfo.name] is
389
395
  // specified, then the provided values (default values allowed) for
390
- // {location}, {collection_id}, {data_store_id}, and {branch_id} are used when
391
- // annotating with the stored Document.
396
+ // `{location}`, `{collection_id}`, `{data_store_id}`, and
397
+ // `{branch_id}` are used when annotating with the stored Document.
392
398
  oneof document_descriptor {
393
399
  // Required. The Document resource ID.
394
400
  string id = 1 [(google.api.field_behavior) = REQUIRED];
395
401
 
396
402
  // Required. The Document resource full name, of the form:
397
- // projects/{project\_id}/locations/{location}/collections/{collection\_id}/dataStores/{data\_store\_id}/branches/{branch\_id}/documents/{document\_id}
403
+ // `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
398
404
  string name = 2 [
399
405
  (google.api.field_behavior) = REQUIRED,
400
406
  (google.api.resource_reference) = {
@@ -451,7 +457,7 @@ message MediaInfo {
451
457
  // Media progress should be computed using only the media_progress_duration
452
458
  // relative to the media total length.
453
459
  //
454
- // This value must be between [0, 1.0] inclusive.
460
+ // This value must be between `[0, 1.0]` inclusive.
455
461
  //
456
462
  // If this is not a playback or the progress cannot be computed (e.g. ongoing
457
463
  // livestream), this field should be unset.