@@ -25,10 +25,13 @@ import "google/cloud/vectorsearch/v1beta/data_object.proto";
2525import "google/cloud/vectorsearch/v1beta/embedding_config.proto" ;
2626import "google/protobuf/struct.proto" ;
2727
28+ option csharp_namespace = "Google.Cloud.VectorSearch.V1Beta" ;
2829option go_package = "cloud.google.com/go/vectorsearch/apiv1beta/vectorsearchpb;vectorsearchpb" ;
2930option java_multiple_files = true ;
3031option java_outer_classname = "DataObjectSearchServiceProto" ;
3132option java_package = "com.google.cloud.vectorsearch.v1beta" ;
33+ option php_namespace = "Google\\Cloud\\VectorSearch\\V1beta" ;
34+ option ruby_package = "Google::Cloud::VectorSearch::V1beta" ;
3235
3336// Service for searching data objects.
3437service DataObjectSearchService {
@@ -98,21 +101,60 @@ message OutputFields {
98101message SearchHint {
99102 // Message to specify the index to use for the search.
100103 message IndexHint {
104+ // Parameters for dense ScaNN.
105+ message DenseScannParams {
106+ // Optional. Dense ANN param overrides to control recall and latency.
107+ // The percentage of leaves to search, in the range [0, 100].
108+ int32 search_leaves_pct = 1 [(google.api.field_behavior ) = OPTIONAL ];
109+
110+ // Optional. The number of initial candidates. Must be a positive integer
111+ // (> 0).
112+ int32 initial_candidate_count = 2
113+ [(google.api.field_behavior ) = OPTIONAL ];
114+ }
115+
116+ // The parameters for the index.
117+ oneof params {
118+ // Optional. Dense ScaNN parameters.
119+ DenseScannParams dense_scann_params = 2
120+ [(google.api.field_behavior ) = OPTIONAL ];
121+ }
122+
101123 // Required. The resource name of the index to use for the search.
102124 // The index must be in the same project, location, and collection.
103125 // Format:
104126 // `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
105- string name = 1 [(google.api.field_behavior ) = REQUIRED ];
127+ string name = 1 [
128+ (google.api.field_behavior ) = REQUIRED ,
129+ (google.api.resource_reference ) = {
130+ type : "vectorsearch.googleapis.com/Index"
131+ }
132+ ];
106133 }
107134
135+ // KnnHint will be used if search should be explicitly done on system's
136+ // default K-Nearest Neighbor (KNN) index engine.
137+ message KnnHint {}
138+
108139 // The type of index to use.
109140 oneof index_type {
110- // Optional. Specifies that the search should use a particular index.
111- IndexHint use_index = 1 [(google.api.field_behavior ) = OPTIONAL ];
141+ // Optional. Deprecated: Use `index_hint` instead.
142+ // Specifies that the search should use a particular index.
143+ IndexHint use_index = 1
144+ [deprecated = true , (google.api.field_behavior ) = OPTIONAL ];
145+
146+ // Optional. Deprecated: Use `knn_hint` instead.
147+ // If set to true, the search will use the system's default
148+ // K-Nearest Neighbor (KNN) index engine.
149+ bool use_knn = 2
150+ [deprecated = true , (google.api.field_behavior ) = OPTIONAL ];
112151
113- // Optional. If set to true , the search will use the system's default
152+ // Optional. If set, the search will use the system's default
114153 // K-Nearest Neighbor (KNN) index engine.
115- bool use_knn = 2 [(google.api.field_behavior ) = OPTIONAL ];
154+ KnnHint knn_hint = 3 [(google.api.field_behavior ) = OPTIONAL ];
155+
156+ // Optional. Specifies that the search should use a particular index.
157+ IndexHint index_hint = 4 [(google.api.field_behavior ) = OPTIONAL ];
116158 }
117159}
118160
@@ -161,8 +203,7 @@ message VectorSearch {
161203
162204 // Optional. The distance metric to use for the KNN search. If not specified,
163205 // DOT_PRODUCT will be used as the default.
164- google.cloud.vectorsearch.v1beta.DistanceMetric distance_metric = 11
165- [(google.api.field_behavior ) = OPTIONAL ];
206+ DistanceMetric distance_metric = 11 [(google.api.field_behavior ) = OPTIONAL ];
166207}
167208
168209// Defines a semantic search operation.
@@ -174,8 +215,8 @@ message SemanticSearch {
174215 // Required. The vector field to search.
175216 string search_field = 2 [(google.api.field_behavior ) = REQUIRED ];
176217
177- // Optional . The task type of the query embedding.
178- EmbeddingTaskType task_type = 5 [(google.api.field_behavior ) = OPTIONAL ];
218+ // Required . The task type of the query embedding.
219+ EmbeddingTaskType task_type = 5 [(google.api.field_behavior ) = REQUIRED ];
179220
180221 // Optional. The fields to return in the search results.
181222 OutputFields output_fields = 3 [(google.api.field_behavior ) = OPTIONAL ];
@@ -235,7 +276,9 @@ message SearchDataObjectsRequest {
235276 }
236277 ];
237278
238- // Optional. The standard list page size.
279+ // Optional. The standard list page size. Only supported for KNN. If not set,
280+ // up to search_type.top_k results will be returned. The maximum value is
281+ // 1000; values above 1000 will be coerced to 1000.
239282 int32 page_size = 5 [(google.api.field_behavior ) = OPTIONAL ];
240283
241284 // Optional. The standard list page token.
@@ -252,7 +295,8 @@ message SearchResult {
252295 // Output only. The matching data object.
253296 DataObject data_object = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
254297
255- // Output only. The similarity distance.
298+ // Output only. Similarity distance or ranker score returned by
299+ // BatchSearchDataObjects.
256300 optional double distance = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
257301}
258302
@@ -263,7 +307,12 @@ message SearchResponseMetadata {
263307 // Output only. The resource name of the index used for the search.
264308 // Format:
265309 // `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
266- string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
310+ string name = 1 [
311+ (google.api.field_behavior ) = OUTPUT_ONLY ,
312+ (google.api.resource_reference ) = {
313+ type : "vectorsearch.googleapis.com/Index"
314+ }
315+ ];
267316 }
268317
269318 // The type of index used.
@@ -315,8 +364,9 @@ message AggregateDataObjectsRequest {
315364// Response message for
316365// [DataObjectSearchService.AggregateDataObjects][google.cloud.vectorsearch.v1beta.DataObjectSearchService.AggregateDataObjects].
317366message AggregateDataObjectsResponse {
318- // The aggregated results of the query.
319- repeated google.protobuf.Struct aggregate_results = 1 ;
367+ // Output only. The aggregated results of the query.
368+ repeated google.protobuf.Struct aggregate_results = 1
369+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
320370}
321371
322372// Request message for
@@ -338,7 +388,8 @@ message QueryDataObjectsRequest {
338388 // Optional. Mask specifying which fields to return.
339389 OutputFields output_fields = 7 [(google.api.field_behavior ) = OPTIONAL ];
340390
341- // Optional. The standard list page size.
391+ // Optional. The standard list page size. Default is 100.
392+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
342393 int32 page_size = 5 [(google.api.field_behavior ) = OPTIONAL ];
343394
344395 // Optional. The standard list page token.
@@ -353,13 +404,14 @@ message QueryDataObjectsRequest {
353404// Response message for
354405// [DataObjectSearchService.QueryDataObjects][google.cloud.vectorsearch.v1beta.DataObjectSearchService.QueryDataObjects].
355406message QueryDataObjectsResponse {
356- // The list of dataObjects that match the query.
357- repeated DataObject data_objects = 4 ;
407+ // Output only. The list of dataObjects that match the query.
408+ repeated DataObject data_objects = 4
409+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
358410
359- // A token to retrieve next page of results.
411+ // Output only. A token to retrieve next page of results.
360412 // Pass to [DataObjectSearchService.QueryDataObjectsRequest.page_token][] to
361413 // obtain that page.
362- string next_page_token = 3 ;
414+ string next_page_token = 3 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
363415}
364416
365417// A request to perform a batch of search operations.
@@ -399,9 +451,6 @@ message Ranker {
399451 oneof ranker {
400452 // Reciprocal Rank Fusion ranking.
401453 ReciprocalRankFusion rrf = 1 ;
402-
403- // Vertex AI ranking.
404- VertexRanker vertex = 2 ;
405454 }
406455}
407456
@@ -411,24 +460,6 @@ message ReciprocalRankFusion {
411460 repeated double weights = 1 [(google.api.field_behavior ) = REQUIRED ];
412461}
413462
414- // Defines a ranker using the Vertex AI ranking service.
415- // See https://cloud.google.com/generative-ai-app-builder/docs/ranking for
416- // details.
417- message VertexRanker {
418- // Required. The query against which the records are ranked and scored.
419- string query = 1 [(google.api.field_behavior ) = REQUIRED ];
420-
421- // Optional. The template used to generate the record's title.
422- string title_template = 2 [(google.api.field_behavior ) = OPTIONAL ];
423-
424- // Optional. The template used to generate the record's content.
425- string content_template = 3 [(google.api.field_behavior ) = OPTIONAL ];
426-
427- // Required. The model used for ranking documents. If no model is specified,
428- // then semantic-ranker-default@latest is used.
429- string model = 4 [(google.api.field_behavior ) = REQUIRED ];
430- }
431-
432463// A response from a batch search operation.
433464message BatchSearchDataObjectsResponse {
434465 // Output only. A list of search responses, one for each request in the batch.
0 commit comments