google-cloud-discovery_engine-v1beta 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.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +429 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +78 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +386 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +114 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +1159 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +768 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +135 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +960 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +919 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +518 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/document_service.rb +58 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +486 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +135 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +443 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/rest.rb +42 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +840 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +768 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/paths.rb +127 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +680 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +919 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +382 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/schema_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +511 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +131 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +463 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1beta/search_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +638 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +768 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +131 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +542 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +919 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +250 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest.rb +53 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service.rb +56 -0
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +7 -2
- data/lib/google/cloud/discovery_engine/v1beta.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +46 -0
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +48 -0
- data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +58 -0
- data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +81 -0
- data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +66 -0
- data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb +55 -0
- data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1beta/schema_pb.rb +47 -0
- data/lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb +61 -0
- data/lib/google/cloud/discoveryengine/v1beta/schema_service_services_pb.rb +53 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +71 -0
- data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +58 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +53 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +59 -0
- data/lib/google-cloud-discovery_engine-v1beta.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/httpbody.rb +80 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +107 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +98 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +107 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +181 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +340 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +84 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +210 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/schema.rb +45 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +180 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +603 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +473 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +64 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +144 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/date.rb +53 -0
- metadata +254 -12
|
@@ -0,0 +1,603 @@
|
|
|
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 V1beta
|
|
24
|
+
# Request message for
|
|
25
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::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] page_size
|
|
44
|
+
# @return [::Integer]
|
|
45
|
+
# Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
|
|
46
|
+
# to return. If unspecified, defaults to a reasonable value. The maximum
|
|
47
|
+
# allowed value is 100. Values above 100 will be coerced to 100.
|
|
48
|
+
#
|
|
49
|
+
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
|
50
|
+
# @!attribute [rw] page_token
|
|
51
|
+
# @return [::String]
|
|
52
|
+
# A page token received from a previous
|
|
53
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client#search SearchService.Search}
|
|
54
|
+
# call. Provide this to retrieve the subsequent page.
|
|
55
|
+
#
|
|
56
|
+
# When paginating, all other parameters provided to
|
|
57
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client#search SearchService.Search}
|
|
58
|
+
# must match the call that provided the page token. Otherwise, an
|
|
59
|
+
# `INVALID_ARGUMENT` error is returned.
|
|
60
|
+
# @!attribute [rw] offset
|
|
61
|
+
# @return [::Integer]
|
|
62
|
+
# A 0-indexed integer that specifies the current offset (that is, starting
|
|
63
|
+
# result location, amongst the
|
|
64
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s deemed by the API
|
|
65
|
+
# as relevant) in search results. This field is only considered if
|
|
66
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#page_token page_token}
|
|
67
|
+
# is unset.
|
|
68
|
+
#
|
|
69
|
+
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
|
70
|
+
# @!attribute [rw] filter
|
|
71
|
+
# @return [::String]
|
|
72
|
+
# The filter syntax consists of an expression language for constructing a
|
|
73
|
+
# predicate from one or more fields of the documents being filtered. Filter
|
|
74
|
+
# expression is case-sensitive.
|
|
75
|
+
#
|
|
76
|
+
# If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
|
77
|
+
# @!attribute [rw] order_by
|
|
78
|
+
# @return [::String]
|
|
79
|
+
# The order in which documents are returned. Document can be ordered by
|
|
80
|
+
# a field in an {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}
|
|
81
|
+
# object. Leave it unset if ordered by relevance. OrderBy expression is
|
|
82
|
+
# case-sensitive.
|
|
83
|
+
#
|
|
84
|
+
# If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
|
85
|
+
# @!attribute [rw] user_info
|
|
86
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::UserInfo]
|
|
87
|
+
# Information about the end user.
|
|
88
|
+
# Highly recommended for analytics. The user_agent string in UserInfo will
|
|
89
|
+
# be used to deduce device_type for analytics.
|
|
90
|
+
# @!attribute [rw] facet_specs
|
|
91
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec>]
|
|
92
|
+
# Facet specifications for faceted search. If empty, no facets are returned.
|
|
93
|
+
#
|
|
94
|
+
# A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
|
|
95
|
+
# error is returned.
|
|
96
|
+
# @!attribute [rw] boost_spec
|
|
97
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec]
|
|
98
|
+
# Boost specification to boost certain documents.
|
|
99
|
+
# @!attribute [rw] params
|
|
100
|
+
# @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}]
|
|
101
|
+
# Additional search parameters.
|
|
102
|
+
#
|
|
103
|
+
# For public website search only, supported values are:
|
|
104
|
+
#
|
|
105
|
+
# * `user_country_code`: string. Default empty. If set to non-empty, results
|
|
106
|
+
# are restricted or boosted based on the location provided.
|
|
107
|
+
# * `search_type`: double. Default empty. Enables non-webpage searching
|
|
108
|
+
# depending on the value. The only valid non-default value is 1,
|
|
109
|
+
# which enables image searching.
|
|
110
|
+
# @!attribute [rw] query_expansion_spec
|
|
111
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec]
|
|
112
|
+
# The query expansion specification that specifies the conditions under which
|
|
113
|
+
# query expansion will occur.
|
|
114
|
+
# @!attribute [rw] spell_correction_spec
|
|
115
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec]
|
|
116
|
+
# The spell correction specification that specifies the mode under
|
|
117
|
+
# which spell correction will take effect.
|
|
118
|
+
# @!attribute [rw] user_pseudo_id
|
|
119
|
+
# @return [::String]
|
|
120
|
+
# A unique identifier for tracking visitors. For example, this could be
|
|
121
|
+
# implemented with an HTTP cookie, which should be able to uniquely identify
|
|
122
|
+
# a visitor on a single device. This unique identifier should not change if
|
|
123
|
+
# the visitor logs in or out of the website.
|
|
124
|
+
#
|
|
125
|
+
# This field should NOT have a fixed value such as `unknown_visitor`.
|
|
126
|
+
#
|
|
127
|
+
# This should be the same identifier as
|
|
128
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::UserEvent#user_pseudo_id UserEvent.user_pseudo_id}
|
|
129
|
+
# and
|
|
130
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::CompleteQueryRequest#user_pseudo_id CompleteQueryRequest.user_pseudo_id}
|
|
131
|
+
#
|
|
132
|
+
# The field must be a UTF-8 encoded string with a length limit of 128
|
|
133
|
+
# characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
|
134
|
+
# @!attribute [rw] content_search_spec
|
|
135
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec]
|
|
136
|
+
# The content search spec that configs the desired behavior of content
|
|
137
|
+
# search.
|
|
138
|
+
# @!attribute [rw] safe_search
|
|
139
|
+
# @return [::Boolean]
|
|
140
|
+
# Whether to turn on safe search. This is only supported for
|
|
141
|
+
# [ContentConfig.PUBLIC_WEBSITE][].
|
|
142
|
+
# @!attribute [rw] user_labels
|
|
143
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
|
144
|
+
# The user labels applied to a resource must meet the following requirements:
|
|
145
|
+
#
|
|
146
|
+
# * Each resource can have multiple labels, up to a maximum of 64.
|
|
147
|
+
# * Each label must be a key-value pair.
|
|
148
|
+
# * Keys have a minimum length of 1 character and a maximum length of 63
|
|
149
|
+
# characters and cannot be empty. Values can be empty and have a maximum
|
|
150
|
+
# length of 63 characters.
|
|
151
|
+
# * Keys and values can contain only lowercase letters, numeric characters,
|
|
152
|
+
# underscores, and dashes. All characters must use UTF-8 encoding, and
|
|
153
|
+
# international characters are allowed.
|
|
154
|
+
# * The key portion of a label must be unique. However, you can use the same
|
|
155
|
+
# key with multiple resources.
|
|
156
|
+
# * Keys must start with a lowercase letter or international character.
|
|
157
|
+
#
|
|
158
|
+
# See [Google Cloud
|
|
159
|
+
# Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
|
160
|
+
# for more details.
|
|
161
|
+
class SearchRequest
|
|
162
|
+
include ::Google::Protobuf::MessageExts
|
|
163
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
164
|
+
|
|
165
|
+
# A facet specification to perform faceted search.
|
|
166
|
+
# @!attribute [rw] facet_key
|
|
167
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey]
|
|
168
|
+
# Required. The facet key specification.
|
|
169
|
+
# @!attribute [rw] limit
|
|
170
|
+
# @return [::Integer]
|
|
171
|
+
# Maximum of facet values that should be returned for this facet. If
|
|
172
|
+
# unspecified, defaults to 20. The maximum allowed value is 300. Values
|
|
173
|
+
# above 300 will be coerced to 300.
|
|
174
|
+
#
|
|
175
|
+
# If this field is negative, an `INVALID_ARGUMENT` is returned.
|
|
176
|
+
# @!attribute [rw] excluded_filter_keys
|
|
177
|
+
# @return [::Array<::String>]
|
|
178
|
+
# List of keys to exclude when faceting.
|
|
179
|
+
#
|
|
180
|
+
#
|
|
181
|
+
# By default,
|
|
182
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
|
|
183
|
+
# is not excluded from the filter unless it is listed in this field.
|
|
184
|
+
#
|
|
185
|
+
# Listing a facet key in this field allows its values to appear as facet
|
|
186
|
+
# results, even when they are filtered out of search results. Using this
|
|
187
|
+
# field does not affect what search results are returned.
|
|
188
|
+
#
|
|
189
|
+
# For example, suppose there are 100 documents with the color facet "Red"
|
|
190
|
+
# and 200 documents with the color facet "Blue". A query containing the
|
|
191
|
+
# filter "color:ANY("Red")" and having "color" as
|
|
192
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key FacetKey.key}
|
|
193
|
+
# would by default return only "Red" documents in the search results, and
|
|
194
|
+
# also return "Red" with count 100 as the only color facet. Although there
|
|
195
|
+
# are also blue documents available, "Blue" would not be shown as an
|
|
196
|
+
# available facet value.
|
|
197
|
+
#
|
|
198
|
+
# If "color" is listed in "excludedFilterKeys", then the query returns the
|
|
199
|
+
# facet values "Red" with count 100 and "Blue" with count 200, because the
|
|
200
|
+
# "color" key is now excluded from the filter. Because this field doesn't
|
|
201
|
+
# affect search results, the search results are still correctly filtered to
|
|
202
|
+
# return only "Red" documents.
|
|
203
|
+
#
|
|
204
|
+
# A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
|
|
205
|
+
# error is returned.
|
|
206
|
+
# @!attribute [rw] enable_dynamic_position
|
|
207
|
+
# @return [::Boolean]
|
|
208
|
+
# Enables dynamic position for this facet. If set to true, the position of
|
|
209
|
+
# this facet among all facets in the response is determined automatically.
|
|
210
|
+
# It will be ordered together with dynamic facets if dynamic
|
|
211
|
+
# facets is enabled. If set to false, the position of this facet in the
|
|
212
|
+
# response will be the same as in the request, and it will be ranked before
|
|
213
|
+
# the facets with dynamic position enable and all dynamic facets.
|
|
214
|
+
#
|
|
215
|
+
# For example, you may always want to have rating facet returned in
|
|
216
|
+
# the response, but it's not necessarily to always display the rating facet
|
|
217
|
+
# at the top. In that case, you can set enable_dynamic_position to true so
|
|
218
|
+
# that the position of rating facet in response will be determined
|
|
219
|
+
# automatically.
|
|
220
|
+
#
|
|
221
|
+
# Another example, assuming you have the following facets in the request:
|
|
222
|
+
#
|
|
223
|
+
# * "rating", enable_dynamic_position = true
|
|
224
|
+
#
|
|
225
|
+
# * "price", enable_dynamic_position = false
|
|
226
|
+
#
|
|
227
|
+
# * "brands", enable_dynamic_position = false
|
|
228
|
+
#
|
|
229
|
+
# And also you have a dynamic facets enable, which will generate a facet
|
|
230
|
+
# 'gender'. Then the final order of the facets in the response can be
|
|
231
|
+
# ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
|
|
232
|
+
# "rating") depends on how API orders "gender" and "rating" facets.
|
|
233
|
+
# However, notice that "price" and "brands" will always be
|
|
234
|
+
# ranked at 1st and 2nd position since their enable_dynamic_position are
|
|
235
|
+
# false.
|
|
236
|
+
class FacetSpec
|
|
237
|
+
include ::Google::Protobuf::MessageExts
|
|
238
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
239
|
+
|
|
240
|
+
# Specifies how a facet is computed.
|
|
241
|
+
# @!attribute [rw] key
|
|
242
|
+
# @return [::String]
|
|
243
|
+
# Required. Supported textual and numerical facet keys in
|
|
244
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} object, over
|
|
245
|
+
# which the facet values are computed. Facet key is case-sensitive.
|
|
246
|
+
# @!attribute [rw] intervals
|
|
247
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::Interval>]
|
|
248
|
+
# Set only if values should be bucketized into intervals. Must be set
|
|
249
|
+
# for facets with numerical values. Must not be set for facet with text
|
|
250
|
+
# values. Maximum number of intervals is 30.
|
|
251
|
+
# @!attribute [rw] restricted_values
|
|
252
|
+
# @return [::Array<::String>]
|
|
253
|
+
# Only get facet for the given restricted values. Only supported on
|
|
254
|
+
# textual fields. For example, suppose "category" has three values
|
|
255
|
+
# "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
|
|
256
|
+
# "restricted_values" to "Action > 2022", the "category" facet will only
|
|
257
|
+
# contain "Action > 2022". Only supported on textual fields. Maximum
|
|
258
|
+
# is 10.
|
|
259
|
+
# @!attribute [rw] prefixes
|
|
260
|
+
# @return [::Array<::String>]
|
|
261
|
+
# Only get facet values that start with the given string prefix. For
|
|
262
|
+
# example, suppose "category" has three values "Action > 2022",
|
|
263
|
+
# "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
|
|
264
|
+
# "category" facet will only contain "Action > 2022" and "Action > 2021".
|
|
265
|
+
# Only supported on textual fields. Maximum is 10.
|
|
266
|
+
# @!attribute [rw] contains
|
|
267
|
+
# @return [::Array<::String>]
|
|
268
|
+
# Only get facet values that contains the given strings. For example,
|
|
269
|
+
# suppose "category" has three values "Action > 2022",
|
|
270
|
+
# "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
|
|
271
|
+
# "category" facet will only contain "Action > 2022" and "Sci-Fi > 2022".
|
|
272
|
+
# Only supported on textual fields. Maximum is 10.
|
|
273
|
+
# @!attribute [rw] case_insensitive
|
|
274
|
+
# @return [::Boolean]
|
|
275
|
+
# True to make facet keys case insensitive when getting faceting
|
|
276
|
+
# values with prefixes or contains; false otherwise.
|
|
277
|
+
# @!attribute [rw] order_by
|
|
278
|
+
# @return [::String]
|
|
279
|
+
# The order in which documents are returned.
|
|
280
|
+
#
|
|
281
|
+
# Allowed values are:
|
|
282
|
+
#
|
|
283
|
+
# * "count desc", which means order by
|
|
284
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count}
|
|
285
|
+
# descending.
|
|
286
|
+
#
|
|
287
|
+
# * "value desc", which means order by
|
|
288
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.value}
|
|
289
|
+
# descending.
|
|
290
|
+
# Only applies to textual facets.
|
|
291
|
+
#
|
|
292
|
+
# If not set, textual values are sorted in [natural
|
|
293
|
+
# order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
|
|
294
|
+
# intervals are sorted in the order given by
|
|
295
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}.
|
|
296
|
+
class FacetKey
|
|
297
|
+
include ::Google::Protobuf::MessageExts
|
|
298
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# Boost specification to boost certain documents.
|
|
303
|
+
# @!attribute [rw] condition_boost_specs
|
|
304
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::BoostSpec::ConditionBoostSpec>]
|
|
305
|
+
# Condition boost specifications. If a document matches multiple conditions
|
|
306
|
+
# in the specifictions, boost scores from these specifications are all
|
|
307
|
+
# applied and combined in a non-linear way. Maximum number of
|
|
308
|
+
# specifications is 20.
|
|
309
|
+
class BoostSpec
|
|
310
|
+
include ::Google::Protobuf::MessageExts
|
|
311
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
312
|
+
|
|
313
|
+
# Boost applies to documents which match a condition.
|
|
314
|
+
# @!attribute [rw] condition
|
|
315
|
+
# @return [::String]
|
|
316
|
+
# An expression which specifies a boost condition. The syntax and
|
|
317
|
+
# supported fields are the same as a filter expression. See
|
|
318
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#filter SearchRequest.filter}
|
|
319
|
+
# for detail syntax and limitations.
|
|
320
|
+
#
|
|
321
|
+
# Examples:
|
|
322
|
+
#
|
|
323
|
+
# * To boost documents with document ID "doc_1" or "doc_2", and
|
|
324
|
+
# color
|
|
325
|
+
# "Red" or "Blue":
|
|
326
|
+
# * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
|
|
327
|
+
# @!attribute [rw] boost
|
|
328
|
+
# @return [::Float]
|
|
329
|
+
# Strength of the condition boost, which should be in [-1, 1]. Negative
|
|
330
|
+
# boost means demotion. Default is 0.0.
|
|
331
|
+
#
|
|
332
|
+
# Setting to 1.0 gives the document a big promotion. However, it does not
|
|
333
|
+
# necessarily mean that the boosted document will be the top result at
|
|
334
|
+
# all times, nor that other documents will be excluded. Results could
|
|
335
|
+
# still be shown even when none of them matches the condition. And
|
|
336
|
+
# results that are significantly more relevant to the search query can
|
|
337
|
+
# still trump your heavily favored but irrelevant documents.
|
|
338
|
+
#
|
|
339
|
+
# Setting to -1.0 gives the document a big demotion. However, results
|
|
340
|
+
# that are deeply relevant might still be shown. The document will have
|
|
341
|
+
# an upstream battle to get a fairly high ranking, but it is not blocked
|
|
342
|
+
# out completely.
|
|
343
|
+
#
|
|
344
|
+
# Setting to 0.0 means no boost applied. The boosting condition is
|
|
345
|
+
# ignored.
|
|
346
|
+
class ConditionBoostSpec
|
|
347
|
+
include ::Google::Protobuf::MessageExts
|
|
348
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Specification to determine under which conditions query expansion should
|
|
353
|
+
# occur.
|
|
354
|
+
# @!attribute [rw] condition
|
|
355
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition]
|
|
356
|
+
# The condition under which query expansion should occur. Default to
|
|
357
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
|
|
358
|
+
class QueryExpansionSpec
|
|
359
|
+
include ::Google::Protobuf::MessageExts
|
|
360
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
361
|
+
|
|
362
|
+
# Enum describing under which condition query expansion should occur.
|
|
363
|
+
module Condition
|
|
364
|
+
# Unspecified query expansion condition. In this case, server behavior
|
|
365
|
+
# defaults to
|
|
366
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}.
|
|
367
|
+
CONDITION_UNSPECIFIED = 0
|
|
368
|
+
|
|
369
|
+
# Disabled query expansion. Only the exact search query is used, even if
|
|
370
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size SearchResponse.total_size}
|
|
371
|
+
# is zero.
|
|
372
|
+
DISABLED = 1
|
|
373
|
+
|
|
374
|
+
# Automatic query expansion built by the Search API.
|
|
375
|
+
AUTO = 2
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# The specification for query spell correction.
|
|
380
|
+
# @!attribute [rw] mode
|
|
381
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode]
|
|
382
|
+
# The mode under which spell correction should take effect to
|
|
383
|
+
# replace the original search query. Default to
|
|
384
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
|
|
385
|
+
class SpellCorrectionSpec
|
|
386
|
+
include ::Google::Protobuf::MessageExts
|
|
387
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
388
|
+
|
|
389
|
+
# Enum describing under which mode spell correction should occur.
|
|
390
|
+
module Mode
|
|
391
|
+
# Unspecified spell correction mode. In this case, server behavior
|
|
392
|
+
# defaults to
|
|
393
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}.
|
|
394
|
+
MODE_UNSPECIFIED = 0
|
|
395
|
+
|
|
396
|
+
# Search API will try to find a spell suggestion if there
|
|
397
|
+
# is any and put in the
|
|
398
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#corrected_query SearchResponse.corrected_query}.
|
|
399
|
+
# The spell suggestion will not be used as the search query.
|
|
400
|
+
SUGGESTION_ONLY = 1
|
|
401
|
+
|
|
402
|
+
# Automatic spell correction built by the Search API. Search will
|
|
403
|
+
# be based on the corrected query if found.
|
|
404
|
+
AUTO = 2
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# The specification that configs the desired behavior of the UCS content
|
|
409
|
+
# search.
|
|
410
|
+
# @!attribute [rw] snippet_spec
|
|
411
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SnippetSpec]
|
|
412
|
+
# If there is no snippet spec provided, there will be no snippet in the
|
|
413
|
+
# search result.
|
|
414
|
+
# @!attribute [rw] summary_spec
|
|
415
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec::SummarySpec]
|
|
416
|
+
# If there is no summary spec provided, there will be no summary in the
|
|
417
|
+
# search response.
|
|
418
|
+
class ContentSearchSpec
|
|
419
|
+
include ::Google::Protobuf::MessageExts
|
|
420
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
421
|
+
|
|
422
|
+
# The specification that configs the snippet in the search results.
|
|
423
|
+
# @!attribute [rw] max_snippet_count
|
|
424
|
+
# @return [::Integer]
|
|
425
|
+
# Max number of snippets returned in each search result.
|
|
426
|
+
# If the matching snippets is less than the max_snippet_count, return all
|
|
427
|
+
# of the snippets; otherwise, return the max_snippet_count.
|
|
428
|
+
#
|
|
429
|
+
# At most 5 snippets will be returned for each SearchResult.
|
|
430
|
+
# @!attribute [rw] reference_only
|
|
431
|
+
# @return [::Boolean]
|
|
432
|
+
# if true, only snippet reference is returned.
|
|
433
|
+
class SnippetSpec
|
|
434
|
+
include ::Google::Protobuf::MessageExts
|
|
435
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# The specification that configs the summary in the search response.
|
|
439
|
+
# @!attribute [rw] summary_result_count
|
|
440
|
+
# @return [::Integer]
|
|
441
|
+
# The number of top results the summary should be generated from.
|
|
442
|
+
# If the number of returned results is less than summary_result_count,
|
|
443
|
+
# then the summary would be derived from all the results; otherwise, the
|
|
444
|
+
# summary would be derived from the top results.
|
|
445
|
+
#
|
|
446
|
+
# At most 5 results can be used for generating summary.
|
|
447
|
+
class SummarySpec
|
|
448
|
+
include ::Google::Protobuf::MessageExts
|
|
449
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
450
|
+
end
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# @!attribute [rw] key
|
|
454
|
+
# @return [::String]
|
|
455
|
+
# @!attribute [rw] value
|
|
456
|
+
# @return [::Google::Protobuf::Value]
|
|
457
|
+
class ParamsEntry
|
|
458
|
+
include ::Google::Protobuf::MessageExts
|
|
459
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
# @!attribute [rw] key
|
|
463
|
+
# @return [::String]
|
|
464
|
+
# @!attribute [rw] value
|
|
465
|
+
# @return [::String]
|
|
466
|
+
class UserLabelsEntry
|
|
467
|
+
include ::Google::Protobuf::MessageExts
|
|
468
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
469
|
+
end
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Response message for
|
|
473
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client#search SearchService.Search}
|
|
474
|
+
# method.
|
|
475
|
+
# @!attribute [rw] results
|
|
476
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult>]
|
|
477
|
+
# A list of matched documents. The order represents the ranking.
|
|
478
|
+
# @!attribute [rw] facets
|
|
479
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet>]
|
|
480
|
+
# Results of facets requested by user.
|
|
481
|
+
# @!attribute [rw] guided_search_result
|
|
482
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::GuidedSearchResult]
|
|
483
|
+
# Guided search result.
|
|
484
|
+
# @!attribute [rw] total_size
|
|
485
|
+
# @return [::Integer]
|
|
486
|
+
# The estimated total count of matched items irrespective of pagination. The
|
|
487
|
+
# count of
|
|
488
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#results results}
|
|
489
|
+
# returned by pagination may be less than the
|
|
490
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse#total_size total_size}
|
|
491
|
+
# that matches.
|
|
492
|
+
# @!attribute [rw] attribution_token
|
|
493
|
+
# @return [::String]
|
|
494
|
+
# A unique search token. This should be included in the
|
|
495
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::UserEvent UserEvent} logs resulting
|
|
496
|
+
# from this search, which enables accurate attribution of search model
|
|
497
|
+
# performance.
|
|
498
|
+
# @!attribute [rw] next_page_token
|
|
499
|
+
# @return [::String]
|
|
500
|
+
# A token that can be sent as
|
|
501
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest#page_token SearchRequest.page_token}
|
|
502
|
+
# to retrieve the next page. If this field is omitted, there are no
|
|
503
|
+
# subsequent pages.
|
|
504
|
+
# @!attribute [rw] corrected_query
|
|
505
|
+
# @return [::String]
|
|
506
|
+
# Contains the spell corrected query, if found. If the spell correction type
|
|
507
|
+
# is AUTOMATIC, then the search results are based on corrected_query.
|
|
508
|
+
# Otherwise the original query is used for search.
|
|
509
|
+
# @!attribute [rw] summary
|
|
510
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Summary]
|
|
511
|
+
# A summary as part of the search results.
|
|
512
|
+
# This field is only returned if
|
|
513
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::ContentSearchSpec#summary_spec SearchRequest.ContentSearchSpec.summary_spec}
|
|
514
|
+
# is set.
|
|
515
|
+
# @!attribute [rw] applied_controls
|
|
516
|
+
# @return [::Array<::String>]
|
|
517
|
+
# Controls applied as part of the Control service.
|
|
518
|
+
class SearchResponse
|
|
519
|
+
include ::Google::Protobuf::MessageExts
|
|
520
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
521
|
+
|
|
522
|
+
# Represents the search results.
|
|
523
|
+
# @!attribute [rw] id
|
|
524
|
+
# @return [::String]
|
|
525
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::Document#id Document.id} of the
|
|
526
|
+
# searched {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}.
|
|
527
|
+
# @!attribute [rw] document
|
|
528
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Document]
|
|
529
|
+
# The document data snippet in the search response. Only fields that are
|
|
530
|
+
# marked as retrievable are populated.
|
|
531
|
+
class SearchResult
|
|
532
|
+
include ::Google::Protobuf::MessageExts
|
|
533
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# A facet result.
|
|
537
|
+
# @!attribute [rw] key
|
|
538
|
+
# @return [::String]
|
|
539
|
+
# The key for this facet. E.g., "colors" or "price". It matches
|
|
540
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}.
|
|
541
|
+
# @!attribute [rw] values
|
|
542
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::Facet::FacetValue>]
|
|
543
|
+
# The facet values for this field.
|
|
544
|
+
# @!attribute [rw] dynamic_facet
|
|
545
|
+
# @return [::Boolean]
|
|
546
|
+
# Whether the facet is dynamically generated.
|
|
547
|
+
class Facet
|
|
548
|
+
include ::Google::Protobuf::MessageExts
|
|
549
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
550
|
+
|
|
551
|
+
# A facet value which contains value names and their count.
|
|
552
|
+
# @!attribute [rw] value
|
|
553
|
+
# @return [::String]
|
|
554
|
+
# Text value of a facet, such as "Black" for facet "colors".
|
|
555
|
+
# @!attribute [rw] interval
|
|
556
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Interval]
|
|
557
|
+
# Interval value for a facet, such as [10, 20) for facet "price". It
|
|
558
|
+
# matches
|
|
559
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}.
|
|
560
|
+
# @!attribute [rw] count
|
|
561
|
+
# @return [::Integer]
|
|
562
|
+
# Number of items that have this facet value.
|
|
563
|
+
class FacetValue
|
|
564
|
+
include ::Google::Protobuf::MessageExts
|
|
565
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
566
|
+
end
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
# Guided search result. The guided search helps user to refine the search
|
|
570
|
+
# results and narrow down to the real needs from a broaded search results.
|
|
571
|
+
# @!attribute [rw] refinement_attributes
|
|
572
|
+
# @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::GuidedSearchResult::RefinementAttribute>]
|
|
573
|
+
# A list of ranked refinement attributes.
|
|
574
|
+
class GuidedSearchResult
|
|
575
|
+
include ::Google::Protobuf::MessageExts
|
|
576
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
577
|
+
|
|
578
|
+
# Useful attribute for search result refinements.
|
|
579
|
+
# @!attribute [rw] attribute_key
|
|
580
|
+
# @return [::String]
|
|
581
|
+
# Attribute key used to refine the results e.g. 'movie_type'.
|
|
582
|
+
# @!attribute [rw] attribute_value
|
|
583
|
+
# @return [::String]
|
|
584
|
+
# Attribute value used to refine the results e.g. 'drama'.
|
|
585
|
+
class RefinementAttribute
|
|
586
|
+
include ::Google::Protobuf::MessageExts
|
|
587
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
588
|
+
end
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
# Summary of the top N search result specified by the summary spec.
|
|
592
|
+
# @!attribute [rw] summary_text
|
|
593
|
+
# @return [::String]
|
|
594
|
+
# The summary content.
|
|
595
|
+
class Summary
|
|
596
|
+
include ::Google::Protobuf::MessageExts
|
|
597
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
598
|
+
end
|
|
599
|
+
end
|
|
600
|
+
end
|
|
601
|
+
end
|
|
602
|
+
end
|
|
603
|
+
end
|