@@ -38,6 +38,21 @@ message Index {
3838 pattern : "projects/{project}/locations/{location}/indexes/{index}"
3939 };
4040
41+ // The update method of an Index.
42+ enum IndexUpdateMethod {
43+ // Should not be used.
44+ INDEX_UPDATE_METHOD_UNSPECIFIED = 0 ;
45+
46+ // BatchUpdate: user can call UpdateIndex with files on Cloud Storage of
47+ // datapoints to update.
48+ BATCH_UPDATE = 1 ;
49+
50+ // StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update
51+ // the Index and the updates will be applied in corresponding
52+ // DeployedIndexes in nearly real-time.
53+ STREAM_UPDATE = 2 ;
54+ }
55+
4156 // Output only. The resource name of the Index.
4257 string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
4358
@@ -93,4 +108,65 @@ message Index {
93108 // in the Index. Result of any successfully completed Operation on the Index
94109 // is reflected in it.
95110 google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior ) = OUTPUT_ONLY ];
111+
112+ // Output only. Stats of the index resource.
113+ IndexStats index_stats = 14 [(google.api.field_behavior ) = OUTPUT_ONLY ];
114+
115+ // Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be
116+ // used by default.
117+ IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior ) = IMMUTABLE ];
118+ }
119+
120+ // A datapoint of Index.
121+ message IndexDatapoint {
122+ // Restriction of a datapoint which describe its attributes(tokens) from each
123+ // of several attribute categories(namespaces).
124+ message Restriction {
125+ // The namespace of this restriction. eg: color.
126+ string namespace = 1 ;
127+
128+ // The attributes to allow in this namespace. eg: 'red'
129+ repeated string allow_list = 2 ;
130+
131+ // The attributes to deny in this namespace. eg: 'blue'
132+ repeated string deny_list = 3 ;
133+ }
134+
135+ // Crowding tag is a constraint on a neighbor list produced by nearest
136+ // neighbor search requiring that no more than some value k' of the k
137+ // neighbors returned have the same value of crowding_attribute.
138+ message CrowdingTag {
139+ // The attribute value used for crowding. The maximum number of neighbors
140+ // to return per crowding attribute value
141+ // (per_crowding_attribute_num_neighbors) is configured per-query. This
142+ // field is ignored if per_crowding_attribute_num_neighbors is larger than
143+ // the total number of neighbors to return for a given query.
144+ string crowding_attribute = 1 ;
145+ }
146+
147+ // Required. Unique identifier of the datapoint.
148+ string datapoint_id = 1 [(google.api.field_behavior ) = REQUIRED ];
149+
150+ // Required. Feature embedding vector. An array of numbers with the length of
151+ // [NearestNeighborSearchConfig.dimensions].
152+ repeated float feature_vector = 2 [(google.api.field_behavior ) = REQUIRED ];
153+
154+ // Optional. List of Restrict of the datapoint, used to perform "restricted searches"
155+ // where boolean rule are used to filter the subset of the database eligible
156+ // for matching.
157+ // See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering
158+ repeated Restriction restricts = 4 [(google.api.field_behavior ) = OPTIONAL ];
159+
160+ // Optional. CrowdingTag of the datapoint, the number of neighbors to return in each
161+ // crowding can be configured during query.
162+ CrowdingTag crowding_tag = 5 [(google.api.field_behavior ) = OPTIONAL ];
163+ }
164+
165+ // Stats of the Index.
166+ message IndexStats {
167+ // Output only. The number of vectors in the Index.
168+ int64 vectors_count = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
169+
170+ // Output only. The number of shards in the Index.
171+ int32 shards_count = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
96172}
0 commit comments