google-cloud-retail-v2 0.3.2 → 0.5.0

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