@google-cloud/vectorsearch 0.2.0 → 0.4.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 (44) hide show
  1. package/README.md +22 -0
  2. package/build/protos/google/cloud/vectorsearch/v1/common.proto +37 -0
  3. package/build/protos/google/cloud/vectorsearch/v1/data_object.proto +95 -0
  4. package/build/protos/google/cloud/vectorsearch/v1/data_object_search_service.proto +409 -0
  5. package/build/protos/google/cloud/vectorsearch/v1/data_object_service.proto +242 -0
  6. package/build/protos/google/cloud/vectorsearch/v1/embedding_config.proto +74 -0
  7. package/build/protos/google/cloud/vectorsearch/v1/vectorsearch_service.proto +710 -0
  8. package/build/protos/google/cloud/vectorsearch/v1beta/common.proto +4 -1
  9. package/build/protos/google/cloud/vectorsearch/v1beta/data_object.proto +8 -3
  10. package/build/protos/google/cloud/vectorsearch/v1beta/data_object_search_service.proto +71 -40
  11. package/build/protos/google/cloud/vectorsearch/v1beta/data_object_service.proto +11 -2
  12. package/build/protos/google/cloud/vectorsearch/v1beta/embedding_config.proto +3 -0
  13. package/build/protos/google/cloud/vectorsearch/v1beta/vectorsearch_service.proto +85 -15
  14. package/build/protos/protos.d.ts +7493 -161
  15. package/build/protos/protos.js +24251 -6379
  16. package/build/protos/protos.json +2260 -56
  17. package/build/src/index.d.ts +12 -10
  18. package/build/src/index.js +7 -5
  19. package/build/src/index.js.map +1 -1
  20. package/build/src/v1/data_object_search_service_client.d.ts +583 -0
  21. package/build/src/v1/data_object_search_service_client.js +855 -0
  22. package/build/src/v1/data_object_search_service_client.js.map +1 -0
  23. package/build/src/v1/data_object_search_service_client_config.json +58 -0
  24. package/build/src/v1/data_object_search_service_proto_list.json +8 -0
  25. package/build/src/v1/data_object_service_client.d.ts +490 -0
  26. package/build/src/v1/data_object_service_client.js +767 -0
  27. package/build/src/v1/data_object_service_client.js.map +1 -0
  28. package/build/src/v1/data_object_service_client_config.json +73 -0
  29. package/build/src/v1/data_object_service_proto_list.json +8 -0
  30. package/build/src/v1/gapic_metadata.json +277 -0
  31. package/build/src/v1/index.d.ts +3 -0
  32. package/build/src/v1/index.js +27 -0
  33. package/build/src/v1/index.js.map +1 -0
  34. package/build/src/v1/vector_search_service_client.d.ts +1021 -0
  35. package/build/src/v1/vector_search_service_client.js +1387 -0
  36. package/build/src/v1/vector_search_service_client.js.map +1 -0
  37. package/build/src/v1/vector_search_service_client_config.json +88 -0
  38. package/build/src/v1/vector_search_service_proto_list.json +8 -0
  39. package/build/src/v1beta/data_object_search_service_client.d.ts +15 -6
  40. package/build/src/v1beta/data_object_search_service_client.js +10 -4
  41. package/build/src/v1beta/data_object_search_service_client.js.map +1 -1
  42. package/build/src/v1beta/data_object_service_client.d.ts +4 -0
  43. package/build/src/v1beta/data_object_service_client.js.map +1 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -57,6 +57,28 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
57
57
 
58
58
  | Sample | Source Code |
59
59
  | --------------------------- | --------------------------------- |
60
+ | aggregate data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_search_service.aggregate_data_objects.js) |
61
+ | batch search data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_search_service.batch_search_data_objects.js) |
62
+ | query data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_search_service.query_data_objects.js) |
63
+ | search data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_search_service.search_data_objects.js) |
64
+ | batch create data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.batch_create_data_objects.js) |
65
+ | batch delete data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.batch_delete_data_objects.js) |
66
+ | batch update data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.batch_update_data_objects.js) |
67
+ | create data object | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.create_data_object.js) |
68
+ | delete data object | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.delete_data_object.js) |
69
+ | get data object | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.get_data_object.js) |
70
+ | update data object | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/data_object_service.update_data_object.js) |
71
+ | cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/snippet_metadata_google.cloud.vectorsearch.v1.json) |
72
+ | create collection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.create_collection.js) |
73
+ | create index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.create_index.js) |
74
+ | delete collection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.delete_collection.js) |
75
+ | delete index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.delete_index.js) |
76
+ | get collection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.get_collection.js) |
77
+ | get index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.get_index.js) |
78
+ | import data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.import_data_objects.js) |
79
+ | list collections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.list_collections.js) |
80
+ | list indexes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.list_indexes.js) |
81
+ | update collection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1/vector_search_service.update_collection.js) |
60
82
  | aggregate data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/data_object_search_service.aggregate_data_objects.js) |
61
83
  | batch search data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/data_object_search_service.batch_search_data_objects.js) |
62
84
  | query data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/data_object_search_service.query_data_objects.js) |
@@ -0,0 +1,37 @@
1
+ // Copyright 2026 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.vectorsearch.v1;
18
+
19
+ option csharp_namespace = "Google.Cloud.VectorSearch.V1";
20
+ option go_package = "cloud.google.com/go/vectorsearch/apiv1/vectorsearchpb;vectorsearchpb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "CommonProto";
23
+ option java_package = "com.google.cloud.vectorsearch.v1";
24
+ option php_namespace = "Google\\Cloud\\VectorSearch\\V1";
25
+ option ruby_package = "Google::Cloud::VectorSearch::V1";
26
+
27
+ // Distance metric for vector search.
28
+ enum DistanceMetric {
29
+ // Default value, distance metric is not specified.
30
+ DISTANCE_METRIC_UNSPECIFIED = 0;
31
+
32
+ // Dot product distance metric.
33
+ DOT_PRODUCT = 1;
34
+
35
+ // Cosine distance metric.
36
+ COSINE_DISTANCE = 2;
37
+ }
@@ -0,0 +1,95 @@
1
+ // Copyright 2026 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.vectorsearch.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/protobuf/struct.proto";
22
+ import "google/protobuf/timestamp.proto";
23
+
24
+ option csharp_namespace = "Google.Cloud.VectorSearch.V1";
25
+ option go_package = "cloud.google.com/go/vectorsearch/apiv1/vectorsearchpb;vectorsearchpb";
26
+ option java_multiple_files = true;
27
+ option java_outer_classname = "DataObjectProto";
28
+ option java_package = "com.google.cloud.vectorsearch.v1";
29
+ option php_namespace = "Google\\Cloud\\VectorSearch\\V1";
30
+ option ruby_package = "Google::Cloud::VectorSearch::V1";
31
+
32
+ // A dataObject resource in Vector Search.
33
+ message DataObject {
34
+ option (google.api.resource) = {
35
+ type: "vectorsearch.googleapis.com/DataObject"
36
+ pattern: "projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}"
37
+ plural: "dataObjects"
38
+ singular: "dataObject"
39
+ };
40
+
41
+ // Identifier. The fully qualified resource name of the dataObject.
42
+ //
43
+ // Format:
44
+ // `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{data_object_id}`
45
+ // The data_object_id must be 1-63 characters
46
+ // long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
47
+ string name = 1 [(google.api.field_behavior) = IDENTIFIER];
48
+
49
+ // Output only. The id of the dataObject.
50
+ string data_object_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
51
+
52
+ // Output only. Timestamp the dataObject was created at.
53
+ google.protobuf.Timestamp create_time = 4
54
+ [(google.api.field_behavior) = OUTPUT_ONLY];
55
+
56
+ // Output only. Timestamp the dataObject was last updated.
57
+ google.protobuf.Timestamp update_time = 5
58
+ [(google.api.field_behavior) = OUTPUT_ONLY];
59
+
60
+ // Optional. The data of the dataObject.
61
+ google.protobuf.Struct data = 6 [(google.api.field_behavior) = OPTIONAL];
62
+
63
+ // Optional. The vectors of the dataObject.
64
+ map<string, Vector> vectors = 7 [(google.api.field_behavior) = OPTIONAL];
65
+
66
+ // Optional. The etag of the dataObject.
67
+ string etag = 8 [(google.api.field_behavior) = OPTIONAL];
68
+ }
69
+
70
+ // A vector which can be either dense or sparse.
71
+ message Vector {
72
+ // The type of the vector.
73
+ oneof vector_type {
74
+ // A dense vector.
75
+ DenseVector dense = 2;
76
+
77
+ // A sparse vector.
78
+ SparseVector sparse = 3;
79
+ }
80
+ }
81
+
82
+ // A dense vector.
83
+ message DenseVector {
84
+ // Required. The values of the vector.
85
+ repeated float values = 1 [(google.api.field_behavior) = REQUIRED];
86
+ }
87
+
88
+ // A sparse vector.
89
+ message SparseVector {
90
+ // Required. The values of the vector.
91
+ repeated float values = 1 [(google.api.field_behavior) = REQUIRED];
92
+
93
+ // Required. The corresponding indices for the values.
94
+ repeated int32 indices = 2 [(google.api.field_behavior) = REQUIRED];
95
+ }
@@ -0,0 +1,409 @@
1
+ // Copyright 2026 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.vectorsearch.v1;
18
+
19
+ import "google/api/annotations.proto";
20
+ import "google/api/client.proto";
21
+ import "google/api/field_behavior.proto";
22
+ import "google/api/resource.proto";
23
+ import "google/cloud/vectorsearch/v1/common.proto";
24
+ import "google/cloud/vectorsearch/v1/data_object.proto";
25
+ import "google/cloud/vectorsearch/v1/embedding_config.proto";
26
+ import "google/protobuf/struct.proto";
27
+
28
+ option csharp_namespace = "Google.Cloud.VectorSearch.V1";
29
+ option go_package = "cloud.google.com/go/vectorsearch/apiv1/vectorsearchpb;vectorsearchpb";
30
+ option java_multiple_files = true;
31
+ option java_outer_classname = "DataObjectSearchServiceProto";
32
+ option java_package = "com.google.cloud.vectorsearch.v1";
33
+ option php_namespace = "Google\\Cloud\\VectorSearch\\V1";
34
+ option ruby_package = "Google::Cloud::VectorSearch::V1";
35
+
36
+ // Service for searching data objects.
37
+ service DataObjectSearchService {
38
+ option (google.api.default_host) = "vectorsearch.googleapis.com";
39
+ option (google.api.oauth_scopes) =
40
+ "https://www.googleapis.com/auth/cloud-platform";
41
+
42
+ // Searches data objects.
43
+ rpc SearchDataObjects(SearchDataObjectsRequest)
44
+ returns (SearchDataObjectsResponse) {
45
+ option (google.api.http) = {
46
+ post: "/v1/{parent=projects/*/locations/*/collections/*}/dataObjects:search"
47
+ body: "*"
48
+ };
49
+ }
50
+
51
+ // Queries data objects.
52
+ rpc QueryDataObjects(QueryDataObjectsRequest)
53
+ returns (QueryDataObjectsResponse) {
54
+ option (google.api.http) = {
55
+ post: "/v1/{parent=projects/*/locations/*/collections/*}/dataObjects:query"
56
+ body: "*"
57
+ };
58
+ }
59
+
60
+ // Aggregates data objects.
61
+ rpc AggregateDataObjects(AggregateDataObjectsRequest)
62
+ returns (AggregateDataObjectsResponse) {
63
+ option (google.api.http) = {
64
+ post: "/v1/{parent=projects/*/locations/*/collections/*}/dataObjects:aggregate"
65
+ body: "*"
66
+ };
67
+ }
68
+
69
+ // Batch searches data objects.
70
+ rpc BatchSearchDataObjects(BatchSearchDataObjectsRequest)
71
+ returns (BatchSearchDataObjectsResponse) {
72
+ option (google.api.http) = {
73
+ post: "/v1/{parent=projects/*/locations/*/collections/*}/dataObjects:batchSearch"
74
+ body: "*"
75
+ };
76
+ }
77
+ }
78
+
79
+ // Aggregation methods.
80
+ enum AggregationMethod {
81
+ // Should not be used.
82
+ AGGREGATION_METHOD_UNSPECIFIED = 0;
83
+
84
+ // Count the number of data objects that match the filter.
85
+ COUNT = 1;
86
+ }
87
+
88
+ // Defines a output fields struct for data in DataObject.
89
+ message OutputFields {
90
+ // Optional. The fields from the data fields to include in the output.
91
+ repeated string data_fields = 1 [(google.api.field_behavior) = OPTIONAL];
92
+
93
+ // Optional. The fields from the vector fields to include in the output.
94
+ repeated string vector_fields = 2 [(google.api.field_behavior) = OPTIONAL];
95
+
96
+ // Optional. The fields from the DataObject metadata to include in the output.
97
+ repeated string metadata_fields = 3 [(google.api.field_behavior) = OPTIONAL];
98
+ }
99
+
100
+ // Represents a hint to the search index engine.
101
+ message SearchHint {
102
+ // Message to specify the index to use for the search.
103
+ message IndexHint {
104
+ // Required. The resource name of the index to use for the search.
105
+ // The index must be in the same project, location, and collection.
106
+ // Format:
107
+ // `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
108
+ string name = 1 [
109
+ (google.api.field_behavior) = REQUIRED,
110
+ (google.api.resource_reference) = {
111
+ type: "vectorsearch.googleapis.com/Index"
112
+ }
113
+ ];
114
+ }
115
+
116
+ // KnnHint will be used if search should be explicitly done on system's
117
+ // default K-Nearest Neighbor (KNN) index engine.
118
+ message KnnHint {}
119
+
120
+ // The type of index to use.
121
+ oneof index_type {
122
+ // Optional. If set, the search will use the system's default
123
+ // K-Nearest Neighbor (KNN) index engine.
124
+ KnnHint knn_hint = 3 [(google.api.field_behavior) = OPTIONAL];
125
+
126
+ // Optional. Specifies that the search should use a particular index.
127
+ IndexHint index_hint = 4 [(google.api.field_behavior) = OPTIONAL];
128
+ }
129
+ }
130
+
131
+ // A single search request within a batch operation.
132
+ message Search {
133
+ // The type of search to perform.
134
+ oneof search_type {
135
+ // A vector-based search.
136
+ VectorSearch vector_search = 1;
137
+
138
+ // A semantic search.
139
+ SemanticSearch semantic_search = 2;
140
+
141
+ // A text search operation.
142
+ TextSearch text_search = 3;
143
+ }
144
+ }
145
+
146
+ // Defines a search operation using a query vector.
147
+ message VectorSearch {
148
+ oneof vector_type {
149
+ // A dense vector for the query.
150
+ DenseVector vector = 1;
151
+
152
+ // A sparse vector for the query.
153
+ SparseVector sparse_vector = 2;
154
+ }
155
+
156
+ // Required. The vector field to search.
157
+ string search_field = 8 [(google.api.field_behavior) = REQUIRED];
158
+
159
+ // Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}},
160
+ // represented as a google.protobuf.Struct.
161
+ google.protobuf.Struct filter = 4 [(google.api.field_behavior) = OPTIONAL];
162
+
163
+ // Optional. The number of nearest neighbors to return.
164
+ optional int32 top_k = 5 [(google.api.field_behavior) = OPTIONAL];
165
+
166
+ // Optional. Mask specifying which fields to return.
167
+ OutputFields output_fields = 7 [(google.api.field_behavior) = OPTIONAL];
168
+
169
+ // Optional. Sets the search hint. If no strategy is specified, the service
170
+ // will use an index if one is available, and fall back to the default KNN
171
+ // search otherwise.
172
+ SearchHint search_hint = 9 [(google.api.field_behavior) = OPTIONAL];
173
+
174
+ // Optional. The distance metric to use for the KNN search. If not specified,
175
+ // DOT_PRODUCT will be used as the default.
176
+ DistanceMetric distance_metric = 11 [(google.api.field_behavior) = OPTIONAL];
177
+ }
178
+
179
+ // Defines a semantic search operation.
180
+ message SemanticSearch {
181
+ // Required. The query text, which is used to generate an embedding according
182
+ // to the embedding model specified in the collection config.
183
+ string search_text = 1 [(google.api.field_behavior) = REQUIRED];
184
+
185
+ // Required. The vector field to search.
186
+ string search_field = 2 [(google.api.field_behavior) = REQUIRED];
187
+
188
+ // Required. The task type of the query embedding.
189
+ EmbeddingTaskType task_type = 5 [(google.api.field_behavior) = REQUIRED];
190
+
191
+ // Optional. The fields to return in the search results.
192
+ OutputFields output_fields = 3 [(google.api.field_behavior) = OPTIONAL];
193
+
194
+ // Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}},
195
+ // represented as a google.protobuf.Struct.
196
+ google.protobuf.Struct filter = 6 [(google.api.field_behavior) = OPTIONAL];
197
+
198
+ // Optional. The number of data objects to return.
199
+ optional int32 top_k = 4 [(google.api.field_behavior) = OPTIONAL];
200
+
201
+ // Optional. Sets the search hint. If no strategy is specified, the service
202
+ // will use an index if one is available, and fall back to KNN search
203
+ // otherwise.
204
+ SearchHint search_hint = 7 [(google.api.field_behavior) = OPTIONAL];
205
+ }
206
+
207
+ // Defines a text search operation.
208
+ message TextSearch {
209
+ // Required. The query text.
210
+ string search_text = 1 [(google.api.field_behavior) = REQUIRED];
211
+
212
+ // Required. The data field names to search.
213
+ repeated string data_field_names = 2 [(google.api.field_behavior) = REQUIRED];
214
+
215
+ // Optional. The fields to return in the search results.
216
+ OutputFields output_fields = 3 [(google.api.field_behavior) = OPTIONAL];
217
+
218
+ // Optional. The number of results to return.
219
+ optional int32 top_k = 4 [(google.api.field_behavior) = OPTIONAL];
220
+
221
+ // Optional. A JSON filter expression, e.g. `{"genre": {"$eq": "sci-fi"}}`,
222
+ // represented as a `google.protobuf.Struct`.
223
+ google.protobuf.Struct filter = 5 [(google.api.field_behavior) = OPTIONAL];
224
+ }
225
+
226
+ // Request for performing a single search.
227
+ message SearchDataObjectsRequest {
228
+ // The query to search for.
229
+ oneof search_type {
230
+ // A vector search operation.
231
+ VectorSearch vector_search = 2;
232
+
233
+ // A semantic search operation.
234
+ SemanticSearch semantic_search = 4;
235
+
236
+ // Optional. A text search operation.
237
+ TextSearch text_search = 7 [(google.api.field_behavior) = OPTIONAL];
238
+ }
239
+
240
+ // Required. The resource name of the Collection for which to search.
241
+ // Format: `projects/{project}/locations/{location}/collections/{collection}`
242
+ string parent = 1 [
243
+ (google.api.field_behavior) = REQUIRED,
244
+ (google.api.resource_reference) = {
245
+ type: "vectorsearch.googleapis.com/Collection"
246
+ }
247
+ ];
248
+
249
+ // Optional. The standard list page size. Only supported for KNN. If not set,
250
+ // up to search_type.top_k results will be returned. The maximum value is
251
+ // 1000; values above 1000 will be coerced to 1000.
252
+ int32 page_size = 5 [(google.api.field_behavior) = OPTIONAL];
253
+
254
+ // Optional. The standard list page token.
255
+ // Typically obtained via
256
+ // [SearchDataObjectsResponse.next_page_token][google.cloud.vectorsearch.v1.SearchDataObjectsResponse.next_page_token]
257
+ // of the previous
258
+ // [DataObjectSearchService.SearchDataObjects][google.cloud.vectorsearch.v1.DataObjectSearchService.SearchDataObjects]
259
+ // call.
260
+ string page_token = 6 [(google.api.field_behavior) = OPTIONAL];
261
+ }
262
+
263
+ // A single search result.
264
+ message SearchResult {
265
+ // Output only. The matching data object.
266
+ DataObject data_object = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
267
+
268
+ // Output only. Similarity distance or ranker score returned by
269
+ // BatchSearchDataObjects.
270
+ optional double distance = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
271
+ }
272
+
273
+ // Response for a search request.
274
+ message SearchDataObjectsResponse {
275
+ // Output only. The list of dataObjects that match the search criteria.
276
+ repeated SearchResult results = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
277
+
278
+ // Output only. A token to retrieve next page of results.
279
+ // Pass to [DataObjectSearchService.SearchDataObjectsRequest.page_token][] to
280
+ // obtain that page.
281
+ string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
282
+ }
283
+
284
+ // Request message for
285
+ // [DataObjectSearchService.AggregateDataObjects][google.cloud.vectorsearch.v1.DataObjectSearchService.AggregateDataObjects].
286
+ message AggregateDataObjectsRequest {
287
+ // Required. The resource name of the Collection for which to query.
288
+ // Format: `projects/{project}/locations/{location}/collections/{collection}`
289
+ string parent = 1 [
290
+ (google.api.field_behavior) = REQUIRED,
291
+ (google.api.resource_reference) = {
292
+ type: "vectorsearch.googleapis.com/Collection"
293
+ }
294
+ ];
295
+
296
+ // Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}},
297
+ // represented as a google.protobuf.Struct.
298
+ google.protobuf.Struct filter = 2 [(google.api.field_behavior) = OPTIONAL];
299
+
300
+ // Required. The aggregation method to apply to the query.
301
+ AggregationMethod aggregate = 3 [(google.api.field_behavior) = REQUIRED];
302
+ }
303
+
304
+ // Response message for
305
+ // [DataObjectSearchService.AggregateDataObjects][google.cloud.vectorsearch.v1.DataObjectSearchService.AggregateDataObjects].
306
+ message AggregateDataObjectsResponse {
307
+ // Output only. The aggregated results of the query.
308
+ repeated google.protobuf.Struct aggregate_results = 1
309
+ [(google.api.field_behavior) = OUTPUT_ONLY];
310
+ }
311
+
312
+ // Request message for
313
+ // [DataObjectSearchService.QueryDataObjects][google.cloud.vectorsearch.v1.DataObjectSearchService.QueryDataObjects].
314
+ message QueryDataObjectsRequest {
315
+ // Required. The resource name of the Collection for which to query.
316
+ // Format: `projects/{project}/locations/{location}/collections/{collection}`
317
+ string parent = 1 [
318
+ (google.api.field_behavior) = REQUIRED,
319
+ (google.api.resource_reference) = {
320
+ type: "vectorsearch.googleapis.com/Collection"
321
+ }
322
+ ];
323
+
324
+ // Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}},
325
+ // represented as a google.protobuf.Struct.
326
+ google.protobuf.Struct filter = 2 [(google.api.field_behavior) = OPTIONAL];
327
+
328
+ // Optional. Mask specifying which fields to return.
329
+ OutputFields output_fields = 7 [(google.api.field_behavior) = OPTIONAL];
330
+
331
+ // Optional. The standard list page size. Default is 100.
332
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
333
+ int32 page_size = 5 [(google.api.field_behavior) = OPTIONAL];
334
+
335
+ // Optional. The standard list page token.
336
+ // Typically obtained via
337
+ // [QueryDataObjectsResponse.next_page_token][google.cloud.vectorsearch.v1.QueryDataObjectsResponse.next_page_token]
338
+ // of the previous
339
+ // [DataObjectSearchService.QueryDataObjects][google.cloud.vectorsearch.v1.DataObjectSearchService.QueryDataObjects]
340
+ // call.
341
+ string page_token = 6 [(google.api.field_behavior) = OPTIONAL];
342
+ }
343
+
344
+ // Response message for
345
+ // [DataObjectSearchService.QueryDataObjects][google.cloud.vectorsearch.v1.DataObjectSearchService.QueryDataObjects].
346
+ message QueryDataObjectsResponse {
347
+ // Output only. The list of dataObjects that match the query.
348
+ repeated DataObject data_objects = 4
349
+ [(google.api.field_behavior) = OUTPUT_ONLY];
350
+
351
+ // Output only. A token to retrieve next page of results.
352
+ // Pass to [DataObjectSearchService.QueryDataObjectsRequest.page_token][] to
353
+ // obtain that page.
354
+ string next_page_token = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
355
+ }
356
+
357
+ // A request to perform a batch of search operations.
358
+ message BatchSearchDataObjectsRequest {
359
+ // Options for combining the results of the batch search operations.
360
+ message CombineResultsOptions {
361
+ // Required. The ranker to use for combining the results.
362
+ Ranker ranker = 1 [(google.api.field_behavior) = REQUIRED];
363
+
364
+ // Optional. Mask specifying which fields to return.
365
+ OutputFields output_fields = 2 [(google.api.field_behavior) = OPTIONAL];
366
+
367
+ // Optional. The number of results to return. If not set, a default value
368
+ // will be used.
369
+ int32 top_k = 3 [(google.api.field_behavior) = OPTIONAL];
370
+ }
371
+
372
+ // Required. The resource name of the Collection for which to search.
373
+ // Format: `projects/{project}/locations/{location}/collections/{collection}`
374
+ string parent = 1 [
375
+ (google.api.field_behavior) = REQUIRED,
376
+ (google.api.resource_reference) = {
377
+ type: "vectorsearch.googleapis.com/Collection"
378
+ }
379
+ ];
380
+
381
+ // Required. A list of search requests to execute in parallel.
382
+ repeated Search searches = 2 [(google.api.field_behavior) = REQUIRED];
383
+
384
+ // Optional. Options for combining the results of the batch search operations.
385
+ CombineResultsOptions combine = 3 [(google.api.field_behavior) = OPTIONAL];
386
+ }
387
+
388
+ // Defines a ranker to combine results from multiple searches.
389
+ message Ranker {
390
+ // The ranking method to use.
391
+ oneof ranker {
392
+ // Reciprocal Rank Fusion ranking.
393
+ ReciprocalRankFusion rrf = 1;
394
+ }
395
+ }
396
+
397
+ // Defines the Reciprocal Rank Fusion (RRF) algorithm for result ranking.
398
+ message ReciprocalRankFusion {
399
+ // Required. The weights to apply to each search result set during fusion.
400
+ repeated double weights = 1 [(google.api.field_behavior) = REQUIRED];
401
+ }
402
+
403
+ // A response from a batch search operation.
404
+ message BatchSearchDataObjectsResponse {
405
+ // Output only. A list of search responses, one for each request in the batch.
406
+ // If a ranker is used, a single ranked list of results is returned.
407
+ repeated SearchDataObjectsResponse results = 1
408
+ [(google.api.field_behavior) = OUTPUT_ONLY];
409
+ }