google-cloud-discovery_engine-v1 0.a → 0.2.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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +451 -0
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb +47 -0
  7. data/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb +78 -0
  8. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +408 -0
  9. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +114 -0
  10. data/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb +52 -0
  11. data/lib/google/cloud/discovery_engine/v1/completion_service.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +959 -0
  13. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb +47 -0
  14. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +176 -0
  15. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +797 -0
  16. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +450 -0
  17. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb +52 -0
  18. data/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb +55 -0
  19. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +1170 -0
  20. data/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb +47 -0
  21. data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +770 -0
  22. data/lib/google/cloud/discovery_engine/v1/document_service/paths.rb +135 -0
  23. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +971 -0
  24. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +977 -0
  25. data/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb +518 -0
  26. data/lib/google/cloud/discovery_engine/v1/document_service/rest.rb +54 -0
  27. data/lib/google/cloud/discovery_engine/v1/document_service.rb +57 -0
  28. data/lib/google/cloud/discovery_engine/v1/rest.rb +42 -0
  29. data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +853 -0
  30. data/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb +47 -0
  31. data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +770 -0
  32. data/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb +127 -0
  33. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +693 -0
  34. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +977 -0
  35. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb +382 -0
  36. data/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb +53 -0
  37. data/lib/google/cloud/discovery_engine/v1/schema_service.rb +56 -0
  38. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +529 -0
  39. data/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +131 -0
  41. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +481 -0
  42. data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +116 -0
  43. data/lib/google/cloud/discovery_engine/v1/search_service/rest.rb +52 -0
  44. data/lib/google/cloud/discovery_engine/v1/search_service.rb +55 -0
  45. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +654 -0
  46. data/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb +47 -0
  47. data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +770 -0
  48. data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +131 -0
  49. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +558 -0
  50. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +977 -0
  51. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +250 -0
  52. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb +53 -0
  53. data/lib/google/cloud/discovery_engine/v1/user_event_service.rb +56 -0
  54. data/lib/google/cloud/discovery_engine/v1/version.rb +7 -2
  55. data/lib/google/cloud/discovery_engine/v1.rb +50 -0
  56. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +46 -0
  57. data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +49 -0
  58. data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +45 -0
  59. data/lib/google/cloud/discoveryengine/v1/conversation_pb.rb +54 -0
  60. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +61 -0
  61. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +67 -0
  62. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +48 -0
  63. data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +58 -0
  64. data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +79 -0
  65. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +66 -0
  66. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +49 -0
  67. data/lib/google/cloud/discoveryengine/v1/schema_pb.rb +47 -0
  68. data/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb +61 -0
  69. data/lib/google/cloud/discoveryengine/v1/schema_service_services_pb.rb +53 -0
  70. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +73 -0
  71. data/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb +45 -0
  72. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +58 -0
  73. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +53 -0
  74. data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +59 -0
  75. data/lib/google-cloud-discovery_engine-v1.rb +21 -0
  76. data/proto_docs/README.md +4 -0
  77. data/proto_docs/google/api/client.rb +381 -0
  78. data/proto_docs/google/api/field_behavior.rb +85 -0
  79. data/proto_docs/google/api/httpbody.rb +80 -0
  80. data/proto_docs/google/api/launch_stage.rb +71 -0
  81. data/proto_docs/google/api/resource.rb +222 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +106 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +111 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +113 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +206 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +108 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +181 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +340 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +84 -0
  90. data/proto_docs/google/cloud/discoveryengine/v1/schema.rb +45 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +177 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +730 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +478 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +64 -0
  95. data/proto_docs/google/longrunning/operations.rb +164 -0
  96. data/proto_docs/google/protobuf/any.rb +144 -0
  97. data/proto_docs/google/protobuf/duration.rb +98 -0
  98. data/proto_docs/google/protobuf/empty.rb +34 -0
  99. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  100. data/proto_docs/google/protobuf/struct.rb +96 -0
  101. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  102. data/proto_docs/google/rpc/status.rb +48 -0
  103. data/proto_docs/google/type/date.rb +53 -0
  104. metadata +277 -13
@@ -0,0 +1,730 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 DiscoveryEngine
23
+ module V1
24
+ # Request message for
25
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
26
+ # method.
27
+ # @!attribute [rw] serving_config
28
+ # @return [::String]
29
+ # Required. The resource name of the Search serving config, such as
30
+ # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
31
+ # This field is used to identify the serving configuration name, set
32
+ # of models used to make the search.
33
+ # @!attribute [rw] branch
34
+ # @return [::String]
35
+ # The branch resource name, such as
36
+ # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
37
+ #
38
+ # Use `default_branch` as the branch ID or leave this field empty, to search
39
+ # documents under the default branch.
40
+ # @!attribute [rw] query
41
+ # @return [::String]
42
+ # Raw search query.
43
+ # @!attribute [rw] image_query
44
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery]
45
+ # Raw image query.
46
+ # @!attribute [rw] page_size
47
+ # @return [::Integer]
48
+ # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to
49
+ # return. If unspecified, defaults to a reasonable value. The maximum allowed
50
+ # value is 100. Values above 100 are coerced to 100.
51
+ #
52
+ # If this field is negative, an `INVALID_ARGUMENT` is returned.
53
+ # @!attribute [rw] page_token
54
+ # @return [::String]
55
+ # A page token received from a previous
56
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
57
+ # call. Provide this to retrieve the subsequent page.
58
+ #
59
+ # When paginating, all other parameters provided to
60
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
61
+ # must match the call that provided the page token. Otherwise, an
62
+ # `INVALID_ARGUMENT` error is returned.
63
+ # @!attribute [rw] offset
64
+ # @return [::Integer]
65
+ # A 0-indexed integer that specifies the current offset (that is, starting
66
+ # result location, amongst the
67
+ # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as
68
+ # relevant) in search results. This field is only considered if
69
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is
70
+ # unset.
71
+ #
72
+ # If this field is negative, an `INVALID_ARGUMENT` is returned.
73
+ # @!attribute [rw] filter
74
+ # @return [::String]
75
+ # The filter syntax consists of an expression language for constructing a
76
+ # predicate from one or more fields of the documents being filtered. Filter
77
+ # expression is case-sensitive.
78
+ #
79
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
80
+ # @!attribute [rw] order_by
81
+ # @return [::String]
82
+ # The order in which documents are returned. Documents can be ordered by
83
+ # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object.
84
+ # Leave it unset if ordered by relevance. `order_by` expression is
85
+ # case-sensitive.
86
+ #
87
+ # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
88
+ # @!attribute [rw] user_info
89
+ # @return [::Google::Cloud::DiscoveryEngine::V1::UserInfo]
90
+ # Information about the end user.
91
+ # Highly recommended for analytics.
92
+ # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent}
93
+ # is used to deduce `device_type` for analytics.
94
+ # @!attribute [rw] facet_specs
95
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec>]
96
+ # Facet specifications for faceted search. If empty, no facets are returned.
97
+ #
98
+ # A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
99
+ # error is returned.
100
+ # @!attribute [rw] boost_spec
101
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
102
+ # Boost specification to boost certain documents.
103
+ # @!attribute [rw] params
104
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
105
+ # Additional search parameters.
106
+ #
107
+ # For public website search only, supported values are:
108
+ #
109
+ # * `user_country_code`: string. Default empty. If set to non-empty, results
110
+ # are restricted or boosted based on the location provided.
111
+ # * `search_type`: double. Default empty. Enables non-webpage searching
112
+ # depending on the value. The only valid non-default value is 1,
113
+ # which enables image searching.
114
+ # @!attribute [rw] query_expansion_spec
115
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec]
116
+ # The query expansion specification that specifies the conditions under which
117
+ # query expansion occurs.
118
+ # @!attribute [rw] spell_correction_spec
119
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec]
120
+ # The spell correction specification that specifies the mode under
121
+ # which spell correction takes effect.
122
+ # @!attribute [rw] user_pseudo_id
123
+ # @return [::String]
124
+ # A unique identifier for tracking visitors. For example, this could be
125
+ # implemented with an HTTP cookie, which should be able to uniquely identify
126
+ # a visitor on a single device. This unique identifier should not change if
127
+ # the visitor logs in or out of the website.
128
+ #
129
+ # This field should NOT have a fixed value such as `unknown_visitor`.
130
+ #
131
+ # This should be the same identifier as
132
+ # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id}
133
+ # and
134
+ # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id CompleteQueryRequest.user_pseudo_id}
135
+ #
136
+ # The field must be a UTF-8 encoded string with a length limit of 128
137
+ # characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
138
+ # @!attribute [rw] content_search_spec
139
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec]
140
+ # A specification for configuring the behavior of content search.
141
+ # @!attribute [rw] safe_search
142
+ # @return [::Boolean]
143
+ # Whether to turn on safe search. This is only supported for
144
+ # website search.
145
+ # @!attribute [rw] user_labels
146
+ # @return [::Google::Protobuf::Map{::String => ::String}]
147
+ # The user labels applied to a resource must meet the following requirements:
148
+ #
149
+ # * Each resource can have multiple labels, up to a maximum of 64.
150
+ # * Each label must be a key-value pair.
151
+ # * Keys have a minimum length of 1 character and a maximum length of 63
152
+ # characters and cannot be empty. Values can be empty and have a maximum
153
+ # length of 63 characters.
154
+ # * Keys and values can contain only lowercase letters, numeric characters,
155
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
156
+ # international characters are allowed.
157
+ # * The key portion of a label must be unique. However, you can use the same
158
+ # key with multiple resources.
159
+ # * Keys must start with a lowercase letter or international character.
160
+ #
161
+ # See [Google Cloud
162
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
163
+ # for more details.
164
+ class SearchRequest
165
+ include ::Google::Protobuf::MessageExts
166
+ extend ::Google::Protobuf::MessageExts::ClassMethods
167
+
168
+ # Specifies the image query input.
169
+ # @!attribute [rw] image_bytes
170
+ # @return [::String]
171
+ # Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
172
+ # BMP.
173
+ class ImageQuery
174
+ include ::Google::Protobuf::MessageExts
175
+ extend ::Google::Protobuf::MessageExts::ClassMethods
176
+ end
177
+
178
+ # A facet specification to perform faceted search.
179
+ # @!attribute [rw] facet_key
180
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey]
181
+ # Required. The facet key specification.
182
+ # @!attribute [rw] limit
183
+ # @return [::Integer]
184
+ # Maximum of facet values that should be returned for this facet. If
185
+ # unspecified, defaults to 20. The maximum allowed value is 300. Values
186
+ # above 300 are coerced to 300.
187
+ #
188
+ # If this field is negative, an `INVALID_ARGUMENT` is returned.
189
+ # @!attribute [rw] excluded_filter_keys
190
+ # @return [::Array<::String>]
191
+ # List of keys to exclude when faceting.
192
+ #
193
+ #
194
+ # By default,
195
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
196
+ # is not excluded from the filter unless it is listed in this field.
197
+ #
198
+ # Listing a facet key in this field allows its values to appear as facet
199
+ # results, even when they are filtered out of search results. Using this
200
+ # field does not affect what search results are returned.
201
+ #
202
+ # For example, suppose there are 100 documents with the color facet "Red"
203
+ # and 200 documents with the color facet "Blue". A query containing the
204
+ # filter "color:ANY("Red")" and having "color" as
205
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
206
+ # would by default return only "Red" documents in the search results, and
207
+ # also return "Red" with count 100 as the only color facet. Although there
208
+ # are also blue documents available, "Blue" would not be shown as an
209
+ # available facet value.
210
+ #
211
+ # If "color" is listed in "excludedFilterKeys", then the query returns the
212
+ # facet values "Red" with count 100 and "Blue" with count 200, because the
213
+ # "color" key is now excluded from the filter. Because this field doesn't
214
+ # affect search results, the search results are still correctly filtered to
215
+ # return only "Red" documents.
216
+ #
217
+ # A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
218
+ # error is returned.
219
+ # @!attribute [rw] enable_dynamic_position
220
+ # @return [::Boolean]
221
+ # Enables dynamic position for this facet. If set to true, the position of
222
+ # this facet among all facets in the response is determined automatically.
223
+ # If dynamic facets are enabled, it is ordered together.
224
+ # If set to false, the position of this facet in the
225
+ # response is the same as in the request, and it is ranked before
226
+ # the facets with dynamic position enable and all dynamic facets.
227
+ #
228
+ # For example, you may always want to have rating facet returned in
229
+ # the response, but it's not necessarily to always display the rating facet
230
+ # at the top. In that case, you can set enable_dynamic_position to true so
231
+ # that the position of rating facet in response is determined
232
+ # automatically.
233
+ #
234
+ # Another example, assuming you have the following facets in the request:
235
+ #
236
+ # * "rating", enable_dynamic_position = true
237
+ #
238
+ # * "price", enable_dynamic_position = false
239
+ #
240
+ # * "brands", enable_dynamic_position = false
241
+ #
242
+ # And also you have a dynamic facets enabled, which generates a facet
243
+ # `gender`. Then the final order of the facets in the response can be
244
+ # ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
245
+ # "rating") depends on how API orders "gender" and "rating" facets.
246
+ # However, notice that "price" and "brands" are always
247
+ # ranked at first and second position because their enable_dynamic_position
248
+ # is false.
249
+ class FacetSpec
250
+ include ::Google::Protobuf::MessageExts
251
+ extend ::Google::Protobuf::MessageExts::ClassMethods
252
+
253
+ # Specifies how a facet is computed.
254
+ # @!attribute [rw] key
255
+ # @return [::String]
256
+ # Required. Supported textual and numerical facet keys in
257
+ # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object, over which
258
+ # the facet values are computed. Facet key is case-sensitive.
259
+ # @!attribute [rw] intervals
260
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Interval>]
261
+ # Set only if values should be bucketed into intervals. Must be set
262
+ # for facets with numerical values. Must not be set for facet with text
263
+ # values. Maximum number of intervals is 30.
264
+ # @!attribute [rw] restricted_values
265
+ # @return [::Array<::String>]
266
+ # Only get facet for the given restricted values. Only supported on
267
+ # textual fields. For example, suppose "category" has three values
268
+ # "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
269
+ # "restricted_values" to "Action > 2022", the "category" facet only
270
+ # contains "Action > 2022". Only supported on textual fields. Maximum
271
+ # is 10.
272
+ # @!attribute [rw] prefixes
273
+ # @return [::Array<::String>]
274
+ # Only get facet values that start with the given string prefix. For
275
+ # example, suppose "category" has three values "Action > 2022",
276
+ # "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
277
+ # "category" facet only contains "Action > 2022" and "Action > 2021".
278
+ # Only supported on textual fields. Maximum is 10.
279
+ # @!attribute [rw] contains
280
+ # @return [::Array<::String>]
281
+ # Only get facet values that contains the given strings. For example,
282
+ # suppose "category" has three values "Action > 2022",
283
+ # "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
284
+ # "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
285
+ # Only supported on textual fields. Maximum is 10.
286
+ # @!attribute [rw] case_insensitive
287
+ # @return [::Boolean]
288
+ # True to make facet keys case insensitive when getting faceting
289
+ # values with prefixes or contains; false otherwise.
290
+ # @!attribute [rw] order_by
291
+ # @return [::String]
292
+ # The order in which documents are returned.
293
+ #
294
+ # Allowed values are:
295
+ #
296
+ # * "count desc", which means order by
297
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
298
+ # descending.
299
+ #
300
+ # * "value desc", which means order by
301
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
302
+ # descending.
303
+ # Only applies to textual facets.
304
+ #
305
+ # If not set, textual values are sorted in [natural
306
+ # order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
307
+ # intervals are sorted in the order given by
308
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
309
+ class FacetKey
310
+ include ::Google::Protobuf::MessageExts
311
+ extend ::Google::Protobuf::MessageExts::ClassMethods
312
+ end
313
+ end
314
+
315
+ # Boost specification to boost certain documents.
316
+ # @!attribute [rw] condition_boost_specs
317
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec>]
318
+ # Condition boost specifications. If a document matches multiple conditions
319
+ # in the specifictions, boost scores from these specifications are all
320
+ # applied and combined in a non-linear way. Maximum number of
321
+ # specifications is 20.
322
+ class BoostSpec
323
+ include ::Google::Protobuf::MessageExts
324
+ extend ::Google::Protobuf::MessageExts::ClassMethods
325
+
326
+ # Boost applies to documents which match a condition.
327
+ # @!attribute [rw] condition
328
+ # @return [::String]
329
+ # An expression which specifies a boost condition. The syntax and
330
+ # supported fields are the same as a filter expression. See
331
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}
332
+ # for detail syntax and limitations.
333
+ #
334
+ # Examples:
335
+ #
336
+ # * To boost documents with document ID "doc_1" or "doc_2", and
337
+ # color
338
+ # "Red" or "Blue":
339
+ # * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
340
+ # @!attribute [rw] boost
341
+ # @return [::Float]
342
+ # Strength of the condition boost, which should be in [-1, 1]. Negative
343
+ # boost means demotion. Default is 0.0.
344
+ #
345
+ # Setting to 1.0 gives the document a big promotion. However, it does not
346
+ # necessarily mean that the boosted document will be the top result at
347
+ # all times, nor that other documents will be excluded. Results could
348
+ # still be shown even when none of them matches the condition. And
349
+ # results that are significantly more relevant to the search query can
350
+ # still trump your heavily favored but irrelevant documents.
351
+ #
352
+ # Setting to -1.0 gives the document a big demotion. However, results
353
+ # that are deeply relevant might still be shown. The document will have
354
+ # an upstream battle to get a fairly high ranking, but it is not blocked
355
+ # out completely.
356
+ #
357
+ # Setting to 0.0 means no boost applied. The boosting condition is
358
+ # ignored.
359
+ class ConditionBoostSpec
360
+ include ::Google::Protobuf::MessageExts
361
+ extend ::Google::Protobuf::MessageExts::ClassMethods
362
+ end
363
+ end
364
+
365
+ # Specification to determine under which conditions query expansion should
366
+ # occur.
367
+ # @!attribute [rw] condition
368
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition]
369
+ # The condition under which query expansion should occur. Default to
370
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
371
+ # @!attribute [rw] pin_unexpanded_results
372
+ # @return [::Boolean]
373
+ # Whether to pin unexpanded results. If this field is set to true,
374
+ # unexpanded products are always at the top of the search results, followed
375
+ # by the expanded results.
376
+ class QueryExpansionSpec
377
+ include ::Google::Protobuf::MessageExts
378
+ extend ::Google::Protobuf::MessageExts::ClassMethods
379
+
380
+ # Enum describing under which condition query expansion should occur.
381
+ module Condition
382
+ # Unspecified query expansion condition. In this case, server behavior
383
+ # defaults to
384
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
385
+ CONDITION_UNSPECIFIED = 0
386
+
387
+ # Disabled query expansion. Only the exact search query is used, even if
388
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#total_size SearchResponse.total_size}
389
+ # is zero.
390
+ DISABLED = 1
391
+
392
+ # Automatic query expansion built by the Search API.
393
+ AUTO = 2
394
+ end
395
+ end
396
+
397
+ # The specification for query spell correction.
398
+ # @!attribute [rw] mode
399
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode]
400
+ # The mode under which spell correction should take effect to
401
+ # replace the original search query. Default to
402
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
403
+ class SpellCorrectionSpec
404
+ include ::Google::Protobuf::MessageExts
405
+ extend ::Google::Protobuf::MessageExts::ClassMethods
406
+
407
+ # Enum describing under which mode spell correction should occur.
408
+ module Mode
409
+ # Unspecified spell correction mode. In this case, server behavior
410
+ # defaults to
411
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
412
+ MODE_UNSPECIFIED = 0
413
+
414
+ # Search API will try to find a spell suggestion if there
415
+ # is any and put in the
416
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#corrected_query SearchResponse.corrected_query}.
417
+ # The spell suggestion will not be used as the search query.
418
+ SUGGESTION_ONLY = 1
419
+
420
+ # Automatic spell correction built by the Search API. Search will
421
+ # be based on the corrected query if found.
422
+ AUTO = 2
423
+ end
424
+ end
425
+
426
+ # A specification for configuring the behavior of content search.
427
+ # @!attribute [rw] snippet_spec
428
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SnippetSpec]
429
+ # If `snippetSpec` is not specified, snippets are not included in the
430
+ # search response.
431
+ # @!attribute [rw] summary_spec
432
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec]
433
+ # If `summarySpec` is not specified, summaries are not included in the
434
+ # search response.
435
+ class ContentSearchSpec
436
+ include ::Google::Protobuf::MessageExts
437
+ extend ::Google::Protobuf::MessageExts::ClassMethods
438
+
439
+ # A specification for configuring snippets in a search response.
440
+ # @!attribute [rw] max_snippet_count
441
+ # @return [::Integer]
442
+ # [DEPRECATED] This field is deprecated. To control snippet return, use
443
+ # `return_snippet` field. For backwards compatibility, we will return
444
+ # snippet if max_snippet_count > 0.
445
+ # @!attribute [rw] reference_only
446
+ # @return [::Boolean]
447
+ # [DEPRECATED] This field is deprecated and will have no affect on the
448
+ # snippet.
449
+ # @!attribute [rw] return_snippet
450
+ # @return [::Boolean]
451
+ # If `true`, then return snippet. If no snippet can be generated, we
452
+ # return "No snippet is available for this page." A `snippet_status` with
453
+ # `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
454
+ class SnippetSpec
455
+ include ::Google::Protobuf::MessageExts
456
+ extend ::Google::Protobuf::MessageExts::ClassMethods
457
+ end
458
+
459
+ # A specification for configuring a summary returned in a search
460
+ # response.
461
+ # @!attribute [rw] summary_result_count
462
+ # @return [::Integer]
463
+ # The number of top results to generate the summary from. If the number
464
+ # of results returned is less than `summaryResultCount`, the summary is
465
+ # generated from all of the results.
466
+ #
467
+ # At most five results can be used to generate a summary.
468
+ # @!attribute [rw] include_citations
469
+ # @return [::Boolean]
470
+ # Specifies whether to include citations in the summary. The default
471
+ # value is `false`.
472
+ #
473
+ # When this field is set to `true`, summaries include in-line citation
474
+ # numbers.
475
+ #
476
+ # Example summary including citations:
477
+ #
478
+ # BigQuery is Google Cloud's fully managed and completely serverless
479
+ # enterprise data warehouse [1]. BigQuery supports all data types, works
480
+ # across clouds, and has built-in machine learning and business
481
+ # intelligence, all within a unified platform [2, 3].
482
+ #
483
+ # The citation numbers refer to the returned search results and are
484
+ # 1-indexed. For example, [1] means that the sentence is attributed to
485
+ # the first search result. [2, 3] means that the sentence is attributed
486
+ # to both the second and third search results.
487
+ # @!attribute [rw] ignore_adversarial_query
488
+ # @return [::Boolean]
489
+ # Specifies whether to filter out adversarial queries. The default value
490
+ # is `false`.
491
+ #
492
+ # Google employs search-query classification to detect adversarial
493
+ # queries. No summary is returned if the search query is classified as an
494
+ # adversarial query. For example, a user might ask a question regarding
495
+ # negative comments about the company or submit a query designed to
496
+ # generate unsafe, policy-violating output. If this field is set to
497
+ # `true`, we skip generating summaries for adversarial queries and return
498
+ # fallback messages instead.
499
+ # @!attribute [rw] ignore_non_summary_seeking_query
500
+ # @return [::Boolean]
501
+ # Specifies whether to filter out queries that are not summary-seeking.
502
+ # The default value is `false`.
503
+ #
504
+ # Google employs search-query classification to detect summary-seeking
505
+ # queries. No summary is returned if the search query is classified as a
506
+ # non-summary seeking query. For example, `why is the sky blue` and `Who
507
+ # is the best soccer player in the world?` are summary-seeking queries,
508
+ # but `SFO airport` and `world cup 2026` are not. They are most likely
509
+ # navigational queries. If this field is set to `true`, we skip
510
+ # generating summaries for non-summary seeking queries and return
511
+ # fallback messages instead.
512
+ # @!attribute [rw] language_code
513
+ # @return [::String]
514
+ # Language code for Summary. Use language tags defined by
515
+ # [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
516
+ class SummarySpec
517
+ include ::Google::Protobuf::MessageExts
518
+ extend ::Google::Protobuf::MessageExts::ClassMethods
519
+ end
520
+ end
521
+
522
+ # @!attribute [rw] key
523
+ # @return [::String]
524
+ # @!attribute [rw] value
525
+ # @return [::Google::Protobuf::Value]
526
+ class ParamsEntry
527
+ include ::Google::Protobuf::MessageExts
528
+ extend ::Google::Protobuf::MessageExts::ClassMethods
529
+ end
530
+
531
+ # @!attribute [rw] key
532
+ # @return [::String]
533
+ # @!attribute [rw] value
534
+ # @return [::String]
535
+ class UserLabelsEntry
536
+ include ::Google::Protobuf::MessageExts
537
+ extend ::Google::Protobuf::MessageExts::ClassMethods
538
+ end
539
+ end
540
+
541
+ # Response message for
542
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search}
543
+ # method.
544
+ # @!attribute [rw] results
545
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>]
546
+ # A list of matched documents. The order represents the ranking.
547
+ # @!attribute [rw] facets
548
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet>]
549
+ # Results of facets requested by user.
550
+ # @!attribute [rw] total_size
551
+ # @return [::Integer]
552
+ # The estimated total count of matched items irrespective of pagination. The
553
+ # count of {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#results results}
554
+ # returned by pagination may be less than the
555
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#total_size total_size}
556
+ # that matches.
557
+ # @!attribute [rw] attribution_token
558
+ # @return [::String]
559
+ # A unique search token. This should be included in the
560
+ # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} logs resulting from
561
+ # this search, which enables accurate attribution of search model
562
+ # performance.
563
+ # @!attribute [rw] redirect_uri
564
+ # @return [::String]
565
+ # The URI of a customer-defined redirect page. If redirect action is
566
+ # triggered, no search is performed, and only
567
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#redirect_uri redirect_uri}
568
+ # and
569
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token attribution_token}
570
+ # are set in the response.
571
+ # @!attribute [rw] next_page_token
572
+ # @return [::String]
573
+ # A token that can be sent as
574
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token SearchRequest.page_token}
575
+ # to retrieve the next page. If this field is omitted, there are no
576
+ # subsequent pages.
577
+ # @!attribute [rw] corrected_query
578
+ # @return [::String]
579
+ # Contains the spell corrected query, if found. If the spell correction type
580
+ # is AUTOMATIC, then the search results are based on corrected_query.
581
+ # Otherwise the original query is used for search.
582
+ # @!attribute [rw] summary
583
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary]
584
+ # A summary as part of the search results.
585
+ # This field is only returned if
586
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#summary_spec SearchRequest.ContentSearchSpec.summary_spec}
587
+ # is set.
588
+ # @!attribute [rw] query_expansion_info
589
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo]
590
+ # Query expansion information for the returned results.
591
+ class SearchResponse
592
+ include ::Google::Protobuf::MessageExts
593
+ extend ::Google::Protobuf::MessageExts::ClassMethods
594
+
595
+ # Represents the search results.
596
+ # @!attribute [rw] id
597
+ # @return [::String]
598
+ # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the
599
+ # searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}.
600
+ # @!attribute [rw] document
601
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Document]
602
+ # The document data snippet in the search response. Only fields that are
603
+ # marked as retrievable are populated.
604
+ class SearchResult
605
+ include ::Google::Protobuf::MessageExts
606
+ extend ::Google::Protobuf::MessageExts::ClassMethods
607
+ end
608
+
609
+ # A facet result.
610
+ # @!attribute [rw] key
611
+ # @return [::String]
612
+ # The key for this facet. E.g., "colors" or "price". It matches
613
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
614
+ # @!attribute [rw] values
615
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>]
616
+ # The facet values for this field.
617
+ # @!attribute [rw] dynamic_facet
618
+ # @return [::Boolean]
619
+ # Whether the facet is dynamically generated.
620
+ class Facet
621
+ include ::Google::Protobuf::MessageExts
622
+ extend ::Google::Protobuf::MessageExts::ClassMethods
623
+
624
+ # A facet value which contains value names and their count.
625
+ # @!attribute [rw] value
626
+ # @return [::String]
627
+ # Text value of a facet, such as "Black" for facet "colors".
628
+ # @!attribute [rw] interval
629
+ # @return [::Google::Cloud::DiscoveryEngine::V1::Interval]
630
+ # Interval value for a facet, such as [10, 20) for facet "price". It
631
+ # matches
632
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
633
+ # @!attribute [rw] count
634
+ # @return [::Integer]
635
+ # Number of items that have this facet value.
636
+ class FacetValue
637
+ include ::Google::Protobuf::MessageExts
638
+ extend ::Google::Protobuf::MessageExts::ClassMethods
639
+ end
640
+ end
641
+
642
+ # Summary of the top N search result specified by the summary spec.
643
+ # @!attribute [rw] summary_text
644
+ # @return [::String]
645
+ # The summary content.
646
+ # @!attribute [rw] summary_skipped_reasons
647
+ # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>]
648
+ # Additional summary-skipped reasons. This provides the reason for ignored
649
+ # cases. If nothing is skipped, this field is not set.
650
+ # @!attribute [rw] safety_attributes
651
+ # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes]
652
+ # A collection of Safety Attribute categories and their associated
653
+ # confidence scores.
654
+ class Summary
655
+ include ::Google::Protobuf::MessageExts
656
+ extend ::Google::Protobuf::MessageExts::ClassMethods
657
+
658
+ # Safety Attribute categories and their associated confidence scores.
659
+ # @!attribute [rw] categories
660
+ # @return [::Array<::String>]
661
+ # The display names of Safety Attribute categories associated with the
662
+ # generated content. Order matches the Scores.
663
+ # @!attribute [rw] scores
664
+ # @return [::Array<::Float>]
665
+ # The confidence scores of the each category, higher
666
+ # value means higher confidence. Order matches the Categories.
667
+ class SafetyAttributes
668
+ include ::Google::Protobuf::MessageExts
669
+ extend ::Google::Protobuf::MessageExts::ClassMethods
670
+ end
671
+
672
+ # An Enum for summary-skipped reasons.
673
+ module SummarySkippedReason
674
+ # Default value. The summary skipped reason is not specified.
675
+ SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0
676
+
677
+ # The adversarial query ignored case.
678
+ #
679
+ # Only populated when
680
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query}
681
+ # is set to `true`.
682
+ ADVERSARIAL_QUERY_IGNORED = 1
683
+
684
+ # The non-summary seeking query ignored case.
685
+ #
686
+ # Only populated when
687
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query SummarySpec.ignore_non_summary_seeking_query}
688
+ # is set to `true`.
689
+ NON_SUMMARY_SEEKING_QUERY_IGNORED = 2
690
+
691
+ # The out-of-domain query ignored case.
692
+ #
693
+ # Google skips the summary if there are no high-relevance search results.
694
+ # For example, the data store contains facts about company A but the
695
+ # user query is asking questions about company B.
696
+ OUT_OF_DOMAIN_QUERY_IGNORED = 3
697
+
698
+ # The potential policy violation case.
699
+ #
700
+ # Google skips the summary if there is a potential policy violation
701
+ # detected. This includes content that may be violent or toxic.
702
+ POTENTIAL_POLICY_VIOLATION = 4
703
+
704
+ # The LLM addon not enabled case.
705
+ #
706
+ # Google skips the summary if the LLM addon is not enabled.
707
+ LLM_ADDON_NOT_ENABLED = 5
708
+ end
709
+ end
710
+
711
+ # Information describing query expansion including whether expansion has
712
+ # occurred.
713
+ # @!attribute [rw] expanded_query
714
+ # @return [::Boolean]
715
+ # Bool describing whether query expansion has occurred.
716
+ # @!attribute [rw] pinned_result_count
717
+ # @return [::Integer]
718
+ # Number of pinned results. This field will only be set when expansion
719
+ # happens and
720
+ # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results}
721
+ # is set to true.
722
+ class QueryExpansionInfo
723
+ include ::Google::Protobuf::MessageExts
724
+ extend ::Google::Protobuf::MessageExts::ClassMethods
725
+ end
726
+ end
727
+ end
728
+ end
729
+ end
730
+ end