google-cloud-retail-v2 0.3.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/retail/v2.rb +2 -0
  5. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  6. data/lib/google/cloud/retail/v2/catalog_service/client.rb +242 -45
  7. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  8. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  9. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +47 -1
  10. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  11. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  12. data/lib/google/cloud/retail/v2/completion_service/client.rb +543 -0
  13. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  14. data/lib/google/cloud/retail/v2/completion_service/operations.rb +664 -0
  15. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  16. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  17. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  18. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  19. data/lib/google/cloud/retail/v2/prediction_service/client.rb +68 -75
  20. data/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +1 -1
  21. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  22. data/lib/google/cloud/retail/v2/product_service/client.rb +684 -48
  23. data/lib/google/cloud/retail/v2/product_service/operations.rb +34 -25
  24. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  25. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +76 -1
  26. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  27. data/lib/google/cloud/retail/v2/search_service/client.rb +531 -0
  28. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  29. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  30. data/lib/google/cloud/retail/v2/search_service_pb.rb +131 -0
  31. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  32. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  33. data/lib/google/cloud/retail/v2/user_event_service/client.rb +47 -47
  34. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +34 -25
  35. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  36. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +1 -1
  37. data/lib/google/cloud/retail/v2/version.rb +1 -1
  38. data/proto_docs/google/api/field_behavior.rb +7 -1
  39. data/proto_docs/google/api/httpbody.rb +4 -3
  40. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  41. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  42. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  43. data/proto_docs/google/cloud/retail/v2/completion_service.rb +162 -0
  44. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  45. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  46. data/proto_docs/google/cloud/retail/v2/product.rb +266 -10
  47. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  48. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  49. data/proto_docs/google/cloud/retail/v2/search_service.rb +681 -0
  50. data/proto_docs/google/cloud/retail/v2/user_event.rb +95 -3
  51. data/proto_docs/google/type/date.rb +53 -0
  52. metadata +20 -4
@@ -33,7 +33,7 @@ module Google
33
33
  # @return [::String]
34
34
  # Required. The resource name of the catalog under which the events are
35
35
  # created. The format is
36
- # "projects/$\\{projectId}/locations/global/catalogs/$\\{catalogId}"
36
+ # `projects/${projectId}/locations/global/catalogs/${catalogId}`
37
37
  # @!attribute [rw] filter
38
38
  # @return [::String]
39
39
  # Required. The filter string to specify the events to be deleted with a
@@ -0,0 +1,681 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Retail
23
+ module V2
24
+ # Request message for
25
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method.
26
+ # @!attribute [rw] placement
27
+ # @return [::String]
28
+ # Required. The resource name of the search engine placement, such as
29
+ # `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
30
+ # This field is used to identify the set of models that will be used to make
31
+ # the search.
32
+ #
33
+ # We currently support one placement with the following ID:
34
+ #
35
+ # * `default_search`.
36
+ # @!attribute [rw] branch
37
+ # @return [::String]
38
+ # The branch resource name, such as
39
+ # `projects/*/locations/global/catalogs/default_catalog/branches/0`.
40
+ #
41
+ # Use "default_branch" as the branch ID or leave this field empty, to search
42
+ # products under the default branch.
43
+ # @!attribute [rw] query
44
+ # @return [::String]
45
+ # Raw search query.
46
+ # @!attribute [rw] visitor_id
47
+ # @return [::String]
48
+ # Required. A unique identifier for tracking visitors. For example, this
49
+ # could be implemented with an HTTP cookie, which should be able to uniquely
50
+ # identify a visitor on a single device. This unique identifier should not
51
+ # change if the visitor logs in or out of the website.
52
+ #
53
+ # The field must be a UTF-8 encoded string with a length limit of 128
54
+ # characters. Otherwise, an INVALID_ARGUMENT error is returned.
55
+ # @!attribute [rw] user_info
56
+ # @return [::Google::Cloud::Retail::V2::UserInfo]
57
+ # User information.
58
+ # @!attribute [rw] page_size
59
+ # @return [::Integer]
60
+ # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If
61
+ # unspecified, defaults to a reasonable value. The maximum allowed value is
62
+ # 120. Values above 120 will be coerced to 120.
63
+ #
64
+ # If this field is negative, an INVALID_ARGUMENT is returned.
65
+ # @!attribute [rw] page_token
66
+ # @return [::String]
67
+ # A page token
68
+ # {::Google::Cloud::Retail::V2::SearchResponse#next_page_token SearchResponse.next_page_token},
69
+ # received from a previous
70
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} call.
71
+ # Provide this to retrieve the subsequent page.
72
+ #
73
+ # When paginating, all other parameters provided to
74
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} must
75
+ # match the call that provided the page token. Otherwise, an INVALID_ARGUMENT
76
+ # error is returned.
77
+ # @!attribute [rw] offset
78
+ # @return [::Integer]
79
+ # A 0-indexed integer that specifies the current offset (that is, starting
80
+ # result location, amongst the {::Google::Cloud::Retail::V2::Product Product}s
81
+ # deemed by the API as relevant) in search results. This field is only
82
+ # considered if {::Google::Cloud::Retail::V2::SearchRequest#page_token page_token}
83
+ # is unset.
84
+ #
85
+ # If this field is negative, an INVALID_ARGUMENT is returned.
86
+ # @!attribute [rw] filter
87
+ # @return [::String]
88
+ # The filter syntax consists of an expression language for constructing a
89
+ # predicate from one or more fields of the products being filtered. Filter
90
+ # expression is case-sensitive.
91
+ #
92
+ # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
93
+ # @!attribute [rw] canonical_filter
94
+ # @return [::String]
95
+ # The filter applied to every search request when quality improvement such as
96
+ # query expansion is needed. For example, if a query does not have enough
97
+ # results, an expanded query with
98
+ # {::Google::Cloud::Retail::V2::SearchRequest#canonical_filter SearchRequest.canonical_filter}
99
+ # will be returned as a supplement of the original query. This field is
100
+ # strongly recommended to achieve high search quality.
101
+ #
102
+ # See {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for
103
+ # more details about filter syntax.
104
+ # @!attribute [rw] order_by
105
+ # @return [::String]
106
+ # The order in which products are returned. Products can be ordered by
107
+ # a field in an {::Google::Cloud::Retail::V2::Product Product} object. Leave it
108
+ # unset if ordered by relevance. OrderBy expression is case-sensitive.
109
+ #
110
+ # If this field is unrecognizable, an INVALID_ARGUMENT is returned.
111
+ # @!attribute [rw] facet_specs
112
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::FacetSpec>]
113
+ # Facet specifications for faceted search. If empty, no facets are returned.
114
+ #
115
+ # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
116
+ # is returned.
117
+ # @!attribute [rw] dynamic_facet_spec
118
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec]
119
+ # The specification for dynamically generated facets. Notice that only
120
+ # textual facets can be dynamically generated.
121
+ #
122
+ # This feature requires additional allowlisting. Contact Retail Support
123
+ # (retail-search-support@google.com) if you are interested in using dynamic
124
+ # facet feature.
125
+ # @!attribute [rw] boost_spec
126
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::BoostSpec]
127
+ # Boost specification to boost certain products.
128
+ # @!attribute [rw] query_expansion_spec
129
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec]
130
+ # The query expansion specification that specifies the conditions under which
131
+ # query expansion will occur.
132
+ # @!attribute [rw] variant_rollup_keys
133
+ # @return [::Array<::String>]
134
+ # The keys to fetch and rollup the matching
135
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
136
+ # {::Google::Cloud::Retail::V2::Product Product}s attributes. The attributes from
137
+ # all the matching {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
138
+ # {::Google::Cloud::Retail::V2::Product Product}s are merged and de-duplicated.
139
+ # Notice that rollup {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
140
+ # {::Google::Cloud::Retail::V2::Product Product}s attributes will lead to extra
141
+ # query latency. Maximum number of keys is 10.
142
+ #
143
+ # For
144
+ # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
145
+ # a fulfillment type and a fulfillment ID must be provided in the format of
146
+ # "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
147
+ # "pickupInStore" is fulfillment type and "store123" is the store ID.
148
+ #
149
+ # Supported keys are:
150
+ #
151
+ # * colorFamilies
152
+ # * price
153
+ # * originalPrice
154
+ # * discount
155
+ # * attributes.key, where key is any key in the
156
+ # {::Google::Cloud::Retail::V2::Product#attributes Product.attributes} map.
157
+ # * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
158
+ # [FulfillmentInfo.Type.PICKUP_IN_STORE][].
159
+ # * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
160
+ # [FulfillmentInfo.Type.SHIP_TO_STORE][].
161
+ # * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
162
+ # [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
163
+ # * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
164
+ # [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
165
+ # * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
166
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
167
+ # * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
168
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
169
+ # * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
170
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
171
+ # * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
172
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
173
+ # * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
174
+ # [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
175
+ #
176
+ # If this field is set to an invalid value other than these, an
177
+ # INVALID_ARGUMENT error is returned.
178
+ # @!attribute [rw] page_categories
179
+ # @return [::Array<::String>]
180
+ # The categories associated with a category page. Required for category
181
+ # navigation queries to achieve good search quality. The format should be
182
+ # the same as
183
+ # {::Google::Cloud::Retail::V2::UserEvent#page_categories UserEvent.page_categories};
184
+ #
185
+ # To represent full path of category, use '>' sign to separate different
186
+ # hierarchies. If '>' is part of the category name, please replace it with
187
+ # other character(s).
188
+ #
189
+ # Category pages include special pages such as sales or promotions. For
190
+ # instance, a special sale page may have the category hierarchy:
191
+ # "pageCategories" : ["Sales > 2017 Black Friday Deals"].
192
+ class SearchRequest
193
+ include ::Google::Protobuf::MessageExts
194
+ extend ::Google::Protobuf::MessageExts::ClassMethods
195
+
196
+ # A facet specification to perform faceted search.
197
+ # @!attribute [rw] facet_key
198
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey]
199
+ # Required. The facet key specification.
200
+ # @!attribute [rw] limit
201
+ # @return [::Integer]
202
+ # Maximum of facet values that should be returned for this facet. If
203
+ # unspecified, defaults to 20. The maximum allowed value is 300. Values
204
+ # above 300 will be coerced to 300.
205
+ #
206
+ # If this field is negative, an INVALID_ARGUMENT is returned.
207
+ # @!attribute [rw] excluded_filter_keys
208
+ # @return [::Array<::String>]
209
+ # List of keys to exclude when faceting.
210
+ #
211
+ # By default,
212
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
213
+ # is not excluded from the filter unless it is listed in this field.
214
+ #
215
+ # For example, suppose there are 100 products with color facet "Red" and
216
+ # 200 products with color facet "Blue". A query containing the filter
217
+ # "colorFamilies:ANY("Red")" and have "colorFamilies" as
218
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
219
+ # will by default return the "Red" with count 100.
220
+ #
221
+ # If this field contains "colorFamilies", then the query returns both the
222
+ # "Red" with count 100 and "Blue" with count 200, because the
223
+ # "colorFamilies" key is now excluded from the filter.
224
+ #
225
+ # A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
226
+ # is returned.
227
+ # @!attribute [rw] enable_dynamic_position
228
+ # @return [::Boolean]
229
+ # Enables dynamic position for this facet. If set to true, the position of
230
+ # this facet among all facets in the response is determined by Google
231
+ # Retail Search. It will be ordered together with dynamic facets if dynamic
232
+ # facets is enabled. If set to false, the position of this facet in the
233
+ # response will be the same as in the request, and it will be ranked before
234
+ # the facets with dynamic position enable and all dynamic facets.
235
+ #
236
+ # For example, you may always want to have rating facet returned in
237
+ # the response, but it's not necessarily to always display the rating facet
238
+ # at the top. In that case, you can set enable_dynamic_position to true so
239
+ # that the position of rating facet in response will be determined by
240
+ # Google Retail Search.
241
+ #
242
+ # Another example, assuming you have the following facets in the request:
243
+ #
244
+ # * "rating", enable_dynamic_position = true
245
+ #
246
+ # * "price", enable_dynamic_position = false
247
+ #
248
+ # * "brands", enable_dynamic_position = false
249
+ #
250
+ # And also you have a dynamic facets enable, which will generate a facet
251
+ # 'gender'. Then the final order of the facets in the response can be
252
+ # ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
253
+ # "rating") depends on how Google Retail Search orders "gender" and
254
+ # "rating" facets. However, notice that "price" and "brands" will always be
255
+ # ranked at 1st and 2nd position since their enable_dynamic_position are
256
+ # false.
257
+ class FacetSpec
258
+ include ::Google::Protobuf::MessageExts
259
+ extend ::Google::Protobuf::MessageExts::ClassMethods
260
+
261
+ # Specifies how a facet is computed.
262
+ # @!attribute [rw] key
263
+ # @return [::String]
264
+ # Required. Supported textual and numerical facet keys in
265
+ # {::Google::Cloud::Retail::V2::Product Product} object, over which the facet
266
+ # values are computed. Facet key is case-sensitive.
267
+ #
268
+ # Allowed facet keys when
269
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query}
270
+ # is not specified:
271
+ #
272
+ # Textual facet keys:
273
+ # * brands
274
+ # * categories
275
+ # * genders
276
+ # * ageGroups
277
+ # * availability
278
+ # * colorFamilies
279
+ # * colors
280
+ # * sizes
281
+ # * materials
282
+ # * patterns
283
+ # * conditions
284
+ # * attributes.key
285
+ # * pickupInStore
286
+ # * shipToStore
287
+ # * sameDayDelivery
288
+ # * nextDayDelivery
289
+ # * customFulfillment1
290
+ # * customFulfillment2
291
+ # * customFulfillment3
292
+ # * customFulfillment4
293
+ # * customFulfillment5
294
+ #
295
+ # Numeric facet keys:
296
+ # * price
297
+ # * discount
298
+ # * rating
299
+ # * ratingCount
300
+ # * attributes.key
301
+ # @!attribute [rw] intervals
302
+ # @return [::Array<::Google::Cloud::Retail::V2::Interval>]
303
+ # Set only if values should be bucketized into intervals. Must be set
304
+ # for facets with numerical values. Must not be set for facet with text
305
+ # values. Maximum number of intervals is 30.
306
+ # @!attribute [rw] restricted_values
307
+ # @return [::Array<::String>]
308
+ # Only get facet for the given restricted values. For example, when using
309
+ # "pickupInStore" as key and set restricted values to
310
+ # ["store123", "store456"], only facets for "store123" and "store456" are
311
+ # returned. Only supported on textual fields and fulfillments.
312
+ # Maximum is 20.
313
+ #
314
+ # Must be set for the fulfillment facet keys:
315
+ #
316
+ # * pickupInStore
317
+ #
318
+ # * shipToStore
319
+ #
320
+ # * sameDayDelivery
321
+ #
322
+ # * nextDayDelivery
323
+ #
324
+ # * customFulfillment1
325
+ #
326
+ # * customFulfillment2
327
+ #
328
+ # * customFulfillment3
329
+ #
330
+ # * customFulfillment4
331
+ #
332
+ # * customFulfillment5
333
+ # @!attribute [rw] prefixes
334
+ # @return [::Array<::String>]
335
+ # Only get facet values that start with the given string prefix. For
336
+ # example, suppose "categories" has three values "Women > Shoe",
337
+ # "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
338
+ # "categories" facet will give only "Women > Shoe" and "Women > Dress".
339
+ # Only supported on textual fields. Maximum is 10.
340
+ # @!attribute [rw] contains
341
+ # @return [::Array<::String>]
342
+ # Only get facet values that contains the given strings. For example,
343
+ # suppose "categories" has three values "Women > Shoe",
344
+ # "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
345
+ # "categories" facet will give only "Women > Shoe" and "Men > Shoe".
346
+ # Only supported on textual fields. Maximum is 10.
347
+ # @!attribute [rw] order_by
348
+ # @return [::String]
349
+ # The order in which [Facet.values][] are returned.
350
+ #
351
+ # Allowed values are:
352
+ #
353
+ # * "count desc", which means order by [Facet.FacetValue.count][]
354
+ # descending.
355
+ #
356
+ # * "value desc", which means order by [Facet.FacetValue.value][]
357
+ # descending.
358
+ # Only applies to textual facets.
359
+ #
360
+ # If not set, textual values are sorted in [natural
361
+ # order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
362
+ # intervals are sorted in the order given by
363
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals};
364
+ # [FulfillmentInfo.ids][] are sorted in the order given by
365
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#restricted_values FacetSpec.FacetKey.restricted_values}.
366
+ # @!attribute [rw] query
367
+ # @return [::String]
368
+ # The query that is used to compute facet for the given facet key.
369
+ # When provided, it will override the default behavior of facet
370
+ # computation. The query syntax is the same as a filter expression. See
371
+ # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for
372
+ # detail syntax and limitations. Notice that there is no limitation on
373
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
374
+ # when query is specified.
375
+ #
376
+ # In the response, [FacetValue.value][] will be always "1" and
377
+ # [FacetValue.count][] will be the number of results that matches the
378
+ # query.
379
+ #
380
+ # For example, you can set a customized facet for "shipToStore",
381
+ # where
382
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
383
+ # is "customizedShipToStore", and
384
+ # {::Google::Cloud::Retail::V2::SearchRequest::FacetSpec::FacetKey#query FacetKey.query}
385
+ # is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
386
+ # Then the facet will count the products that are both in stock and ship
387
+ # to store "123".
388
+ class FacetKey
389
+ include ::Google::Protobuf::MessageExts
390
+ extend ::Google::Protobuf::MessageExts::ClassMethods
391
+ end
392
+ end
393
+
394
+ # The specifications of dynamically generated facets.
395
+ # @!attribute [rw] mode
396
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode]
397
+ # Mode of the DynamicFacet feature.
398
+ # Defaults to
399
+ # {::Google::Cloud::Retail::V2::SearchRequest::DynamicFacetSpec::Mode::DISABLED Mode.DISABLED}
400
+ # if it's unset.
401
+ class DynamicFacetSpec
402
+ include ::Google::Protobuf::MessageExts
403
+ extend ::Google::Protobuf::MessageExts::ClassMethods
404
+
405
+ # Enum to control DynamicFacet mode
406
+ module Mode
407
+ # Default value.
408
+ MODE_UNSPECIFIED = 0
409
+
410
+ # Disable Dynamic Facet.
411
+ DISABLED = 1
412
+
413
+ # Automatic mode built by Google Retail Search.
414
+ ENABLED = 2
415
+ end
416
+ end
417
+
418
+ # Boost specification to boost certain items.
419
+ # @!attribute [rw] condition_boost_specs
420
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchRequest::BoostSpec::ConditionBoostSpec>]
421
+ # Condition boost specifications. If a product matches multiple conditions
422
+ # in the specifictions, boost scores from these specifications are all
423
+ # applied and combined in a non-linear way. Maximum number of
424
+ # specifications is 10.
425
+ class BoostSpec
426
+ include ::Google::Protobuf::MessageExts
427
+ extend ::Google::Protobuf::MessageExts::ClassMethods
428
+
429
+ # Boost applies to products which match a condition.
430
+ # @!attribute [rw] condition
431
+ # @return [::String]
432
+ # An expression which specifies a boost condition. The syntax and
433
+ # supported fields are the same as a filter expression. See
434
+ # {::Google::Cloud::Retail::V2::SearchRequest#filter SearchRequest.filter} for
435
+ # detail syntax and limitations.
436
+ #
437
+ # Examples:
438
+ #
439
+ # * To boost products with product ID "product_1" or "product_2", and
440
+ # color "Red" or "Blue":
441
+ # ```
442
+ # (id: ANY("product_1", "product_2"))
443
+ # AND
444
+ # (colorFamilies: ANY("Red", "Blue"))
445
+ # ```
446
+ # @!attribute [rw] boost
447
+ # @return [::Float]
448
+ # Strength of the condition boost, which should be in [-1, 1]. Negative
449
+ # boost means demotion. Default is 0.0.
450
+ #
451
+ # Setting to 1.0 gives the item a big promotion. However, it does not
452
+ # necessarily mean that the boosted item will be the top result at all
453
+ # times, nor that other items will be excluded. Results could still be
454
+ # shown even when none of them matches the condition. And results that
455
+ # are significantly more relevant to the search query can still trump
456
+ # your heavily favored but irrelevant items.
457
+ #
458
+ # Setting to -1.0 gives the item a big demotion. However, results that
459
+ # are deeply relevant might still be shown. The item will have an
460
+ # upstream battle to get a fairly high ranking, but it is not blocked out
461
+ # completely.
462
+ #
463
+ # Setting to 0.0 means no boost applied. The boosting condition is
464
+ # ignored.
465
+ class ConditionBoostSpec
466
+ include ::Google::Protobuf::MessageExts
467
+ extend ::Google::Protobuf::MessageExts::ClassMethods
468
+ end
469
+ end
470
+
471
+ # Specification to determine under which conditions query expansion should
472
+ # occur.
473
+ # @!attribute [rw] condition
474
+ # @return [::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition]
475
+ # The condition under which query expansion should occur. Default to
476
+ # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
477
+ class QueryExpansionSpec
478
+ include ::Google::Protobuf::MessageExts
479
+ extend ::Google::Protobuf::MessageExts::ClassMethods
480
+
481
+ # Enum describing under which condition query expansion should occur.
482
+ module Condition
483
+ # Unspecified query expansion condition. This defaults to
484
+ # {::Google::Cloud::Retail::V2::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
485
+ CONDITION_UNSPECIFIED = 0
486
+
487
+ # Disabled query expansion. Only the exact search query is used, even if
488
+ # {::Google::Cloud::Retail::V2::SearchResponse#total_size SearchResponse.total_size}
489
+ # is zero.
490
+ DISABLED = 1
491
+
492
+ # Automatic query expansion built by Google Retail Search.
493
+ AUTO = 3
494
+ end
495
+ end
496
+ end
497
+
498
+ # Response message for
499
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} method.
500
+ # @!attribute [rw] results
501
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::SearchResult>]
502
+ # A list of matched items. The order represents the ranking.
503
+ # @!attribute [rw] facets
504
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet>]
505
+ # Results of facets requested by user.
506
+ # @!attribute [rw] total_size
507
+ # @return [::Integer]
508
+ # The estimated total count of matched items irrespective of pagination. The
509
+ # count of {::Google::Cloud::Retail::V2::SearchResponse#results results} returned
510
+ # by pagination may be less than the
511
+ # {::Google::Cloud::Retail::V2::SearchResponse#total_size total_size} that
512
+ # matches.
513
+ # @!attribute [rw] corrected_query
514
+ # @return [::String]
515
+ # If spell correction applies, the corrected query. Otherwise, empty.
516
+ # @!attribute [rw] attribution_token
517
+ # @return [::String]
518
+ # A unique search token. This should be included in the
519
+ # {::Google::Cloud::Retail::V2::UserEvent UserEvent} logs resulting from this
520
+ # search, which enables accurate attribution of search model performance.
521
+ # @!attribute [rw] next_page_token
522
+ # @return [::String]
523
+ # A token that can be sent as
524
+ # {::Google::Cloud::Retail::V2::SearchRequest#page_token SearchRequest.page_token}
525
+ # to retrieve the next page. If this field is omitted, there are no
526
+ # subsequent pages.
527
+ # @!attribute [rw] query_expansion_info
528
+ # @return [::Google::Cloud::Retail::V2::SearchResponse::QueryExpansionInfo]
529
+ # Query expansion information for the returned results.
530
+ # @!attribute [rw] redirect_uri
531
+ # @return [::String]
532
+ # The URI of a customer-defined redirect page. If redirect action is
533
+ # triggered, no search will be performed, and only
534
+ # {::Google::Cloud::Retail::V2::SearchResponse#redirect_uri redirect_uri} and
535
+ # {::Google::Cloud::Retail::V2::SearchResponse#attribution_token attribution_token}
536
+ # will be set in the response.
537
+ class SearchResponse
538
+ include ::Google::Protobuf::MessageExts
539
+ extend ::Google::Protobuf::MessageExts::ClassMethods
540
+
541
+ # Represents the search results.
542
+ # @!attribute [rw] id
543
+ # @return [::String]
544
+ # {::Google::Cloud::Retail::V2::Product#id Product.id} of the searched
545
+ # {::Google::Cloud::Retail::V2::Product Product}.
546
+ # @!attribute [rw] product
547
+ # @return [::Google::Cloud::Retail::V2::Product]
548
+ # The product data snippet in the search response. Only
549
+ # {::Google::Cloud::Retail::V2::Product#name Product.name} is guaranteed to be
550
+ # populated.
551
+ #
552
+ # {::Google::Cloud::Retail::V2::Product#variants Product.variants} contains the
553
+ # product variants that match the search query. If there are multiple
554
+ # product variants matching the query, top 5 most relevant product variants
555
+ # are returned and ordered by relevancy.
556
+ #
557
+ # If relevancy can be deternmined, use
558
+ # {::Google::Cloud::Retail::V2::SearchResponse::SearchResult#matching_variant_fields matching_variant_fields}
559
+ # to look up matched product variants fields. If relevancy cannot be
560
+ # determined, e.g. when searching "shoe" all products in a shoe product can
561
+ # be a match, 5 product variants are returned but order is meaningless.
562
+ # @!attribute [rw] matching_variant_count
563
+ # @return [::Integer]
564
+ # The count of matched
565
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
566
+ # {::Google::Cloud::Retail::V2::Product Product}s.
567
+ # @!attribute [rw] matching_variant_fields
568
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::FieldMask}]
569
+ # If a {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
570
+ # {::Google::Cloud::Retail::V2::Product Product} matches the search query, this
571
+ # map indicates which {::Google::Cloud::Retail::V2::Product Product} fields are
572
+ # matched. The key is the
573
+ # {::Google::Cloud::Retail::V2::Product#name Product.name}, the value is a field
574
+ # mask of the matched {::Google::Cloud::Retail::V2::Product Product} fields. If
575
+ # matched attributes cannot be determined, this map will be empty.
576
+ #
577
+ # For example, a key "sku1" with field mask
578
+ # "products.color_info" indicates there is a match between
579
+ # "sku1" {::Google::Cloud::Retail::V2::ColorInfo ColorInfo} and the query.
580
+ # @!attribute [rw] variant_rollup_values
581
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
582
+ # The rollup matching
583
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variant}
584
+ # {::Google::Cloud::Retail::V2::Product Product} attributes. The key is one of
585
+ # the
586
+ # {::Google::Cloud::Retail::V2::SearchRequest#variant_rollup_keys SearchRequest.variant_rollup_keys}.
587
+ # The values are the merged and de-duplicated
588
+ # {::Google::Cloud::Retail::V2::Product Product} attributes. Notice that the
589
+ # rollup values are respect filter. For example, when filtering by
590
+ # "colorFamilies:ANY(\"red\")" and rollup "colorFamilies", only "red" is
591
+ # returned.
592
+ #
593
+ # For textual and numerical attributes, the rollup values is a list of
594
+ # string or double values with type
595
+ # {::Google::Protobuf::ListValue google.protobuf.ListValue}. For example, if
596
+ # there are two variants with colors "red" and "blue", the rollup values
597
+ # are
598
+ #
599
+ # { key: "colorFamilies"
600
+ # value {
601
+ # list_value {
602
+ # values { string_value: "red" }
603
+ # values { string_value: "blue" }
604
+ # }
605
+ # }
606
+ # }
607
+ #
608
+ # For
609
+ # {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info},
610
+ # the rollup values is a double value with type
611
+ # {::Google::Protobuf::Value google.protobuf.Value}. For example:
612
+ # `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
613
+ # are 10 variants in this product are available in the store "store1".
614
+ class SearchResult
615
+ include ::Google::Protobuf::MessageExts
616
+ extend ::Google::Protobuf::MessageExts::ClassMethods
617
+
618
+ # @!attribute [rw] key
619
+ # @return [::String]
620
+ # @!attribute [rw] value
621
+ # @return [::Google::Protobuf::FieldMask]
622
+ class MatchingVariantFieldsEntry
623
+ include ::Google::Protobuf::MessageExts
624
+ extend ::Google::Protobuf::MessageExts::ClassMethods
625
+ end
626
+
627
+ # @!attribute [rw] key
628
+ # @return [::String]
629
+ # @!attribute [rw] value
630
+ # @return [::Google::Protobuf::Value]
631
+ class VariantRollupValuesEntry
632
+ include ::Google::Protobuf::MessageExts
633
+ extend ::Google::Protobuf::MessageExts::ClassMethods
634
+ end
635
+ end
636
+
637
+ # A facet result.
638
+ # @!attribute [rw] key
639
+ # @return [::String]
640
+ # The key for this facet. E.g., "colorFamilies" or "price" or
641
+ # "attributes.attr1".
642
+ # @!attribute [rw] values
643
+ # @return [::Array<::Google::Cloud::Retail::V2::SearchResponse::Facet::FacetValue>]
644
+ # The facet values for this field.
645
+ # @!attribute [rw] dynamic_facet
646
+ # @return [::Boolean]
647
+ # Whether the facet is dynamically generated.
648
+ class Facet
649
+ include ::Google::Protobuf::MessageExts
650
+ extend ::Google::Protobuf::MessageExts::ClassMethods
651
+
652
+ # A facet value which contains value names and their count.
653
+ # @!attribute [rw] value
654
+ # @return [::String]
655
+ # Text value of a facet, such as "Black" for facet "colorFamilies".
656
+ # @!attribute [rw] interval
657
+ # @return [::Google::Cloud::Retail::V2::Interval]
658
+ # Interval value for a facet, such as [10, 20) for facet "price".
659
+ # @!attribute [rw] count
660
+ # @return [::Integer]
661
+ # Number of items that have this facet value.
662
+ class FacetValue
663
+ include ::Google::Protobuf::MessageExts
664
+ extend ::Google::Protobuf::MessageExts::ClassMethods
665
+ end
666
+ end
667
+
668
+ # Information describing query expansion including whether expansion has
669
+ # occurred.
670
+ # @!attribute [rw] expanded_query
671
+ # @return [::Boolean]
672
+ # Bool describing whether query expansion has occurred.
673
+ class QueryExpansionInfo
674
+ include ::Google::Protobuf::MessageExts
675
+ extend ::Google::Protobuf::MessageExts::ClassMethods
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end
681
+ end