Skip to content

Commit 04eab7d

Browse files
committed
update grpc
1 parent bed2a4f commit 04eab7d

File tree

6 files changed

+595
-16
lines changed

6 files changed

+595
-16
lines changed

packages/js-client-grpc/proto/collections.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ enum PayloadSchemaType {
129129
Text = 5;
130130
Bool = 6;
131131
Datetime = 7;
132+
Uuid = 8;
132133
}
133134

134135
enum QuantizationType {
@@ -386,14 +387,20 @@ enum TokenizerType {
386387
}
387388

388389
message KeywordIndexParams {
390+
optional bool is_tenant = 1; // If true - used for tenant optimization.
391+
optional bool on_disk = 2; // If true - store index on disk.
389392
}
390393

391394
message IntegerIndexParams {
392395
bool lookup = 1; // If true - support direct lookups.
393396
bool range = 2; // If true - support ranges filters.
397+
optional bool is_principal = 3; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
398+
optional bool on_disk = 4; // If true - store index on disk.
394399
}
395400

396401
message FloatIndexParams {
402+
optional bool on_disk = 1; // If true - store index on disk.
403+
optional bool is_principal = 2; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
397404
}
398405

399406
message GeoIndexParams {
@@ -410,6 +417,13 @@ message BoolIndexParams {
410417
}
411418

412419
message DatetimeIndexParams {
420+
optional bool on_disk = 1; // If true - store index on disk.
421+
optional bool is_principal = 2; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
422+
}
423+
424+
message UuidIndexParams {
425+
optional bool is_tenant = 1; // If true - used for tenant optimization.
426+
optional bool on_disk = 2; // If true - store index on disk.
413427
}
414428

415429
message PayloadIndexParams {
@@ -421,6 +435,7 @@ message PayloadIndexParams {
421435
TextIndexParams text_index_params = 1; // Parameters for text index
422436
BoolIndexParams bool_index_params = 6; // Parameters for bool index
423437
DatetimeIndexParams datetime_index_params = 7; // Parameters for datetime index
438+
UuidIndexParams uuid_index_params = 8; // Parameters for uuid index
424439
}
425440
}
426441

packages/js-client-grpc/proto/points.proto

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ message GetPoints {
113113
optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response
114114
optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees
115115
optional ShardKeySelector shard_key_selector = 7; // Specify in which shards to look for the points, if not specified - look in all shards
116+
optional uint64 timeout = 8; // If set, overrides global timeout setting for this request. Unit is seconds.
116117
}
117118

118119
message UpdatePointVectors {
@@ -174,6 +175,7 @@ enum FieldType {
174175
FieldTypeText = 4;
175176
FieldTypeBool = 5;
176177
FieldTypeDatetime = 6;
178+
FieldTypeUuid = 7;
177179
}
178180

179181
message CreateFieldIndexCollection {
@@ -266,7 +268,7 @@ message SearchParams {
266268
optional bool exact = 2;
267269

268270
/*
269-
If set to true, search will ignore quantized vector data
271+
If set to true, search will ignore quantized vector data
270272
*/
271273
optional QuantizationSearchParams quantization = 3;
272274
/*
@@ -359,16 +361,17 @@ message ScrollPoints {
359361
optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees
360362
optional ShardKeySelector shard_key_selector = 9; // Specify in which shards to look for the points, if not specified - look in all shards
361363
optional OrderBy order_by = 10; // Order the records by a payload field
364+
optional uint64 timeout = 11; // If set, overrides global timeout setting for this request. Unit is seconds.
362365
}
363366

364367
// How to use positive and negative vectors to find the results, default is `AverageVector`.
365368
enum RecommendStrategy {
366-
// Average positive and negative vectors and create a single query with the formula
369+
// Average positive and negative vectors and create a single query with the formula
367370
// `query = avg_pos + avg_pos - avg_neg`. Then performs normal search.
368371
AverageVector = 0;
369372

370-
// Uses custom search objective. Each candidate is compared against all
371-
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
373+
// Uses custom search objective. Each candidate is compared against all
374+
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
372375
// If the `max_neg_score` is chosen then it is squared and negated.
373376
BestScore = 1;
374377
}
@@ -434,7 +437,7 @@ message RecommendPointGroups {
434437
message TargetVector {
435438
oneof target {
436439
VectorExample single = 1;
437-
440+
438441
// leaving extensibility for possibly adding multi-target
439442
}
440443
}
@@ -481,6 +484,7 @@ message CountPoints {
481484
optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count
482485
optional ReadConsistency read_consistency = 4; // Options for specifying read consistency guarantees
483486
optional ShardKeySelector shard_key_selector = 5; // Specify in which shards to look for the points, if not specified - look in all shards
487+
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
484488
}
485489

486490
message RecommendInput {
@@ -505,6 +509,16 @@ message ContextInput {
505509

506510
enum Fusion {
507511
RRF = 0; // Reciprocal Rank Fusion
512+
DBSF = 1; // Distribution-Based Score Fusion
513+
}
514+
515+
// Sample points from the collection
516+
//
517+
// Available sampling methods:
518+
//
519+
// * `random` - Random sampling
520+
enum Sample {
521+
Random = 0;
508522
}
509523

510524
message Query {
@@ -515,6 +529,7 @@ message Query {
515529
ContextInput context = 4; // Return points that live in positive areas.
516530
OrderBy order_by = 5; // Order the points by a payload field.
517531
Fusion fusion = 6; // Fuse the results of multiple prefetches.
532+
Sample sample = 7; // Sample points from the collection.
518533
}
519534
}
520535

@@ -554,6 +569,37 @@ message QueryBatchPoints {
554569
optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
555570
}
556571

572+
message QueryPointGroups {
573+
string collection_name = 1; // Name of the collection
574+
repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
575+
optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs.
576+
optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used.
577+
optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions.
578+
optional SearchParams params = 6; // Search params for when there is no prefetch.
579+
optional float score_threshold = 7; // Return points with scores better than this threshold.
580+
WithPayloadSelector with_payload = 8; // Options for specifying which payload to include or not
581+
optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response
582+
optional LookupLocation lookup_from = 10; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector
583+
optional uint64 limit = 11; // Max number of points. Default is 3.
584+
optional uint64 group_size = 12; // Maximum amount of points to return per group. Default to 10.
585+
string group_by = 13; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups.
586+
optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
587+
optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection
588+
optional uint64 timeout = 16; // If set, overrides global timeout setting for this request. Unit is seconds.
589+
optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards
590+
}
591+
592+
message FacetValue {
593+
oneof variant {
594+
string string_value = 1; // String value from the facet
595+
}
596+
}
597+
598+
message FacetValueHit {
599+
FacetValue value = 1; // Value from the facet
600+
uint64 count = 2; // Number of points with this value
601+
}
602+
557603
message PointsUpdateOperation {
558604
message PointStructList {
559605
repeated PointStruct points = 1;
@@ -667,7 +713,7 @@ message GroupId {
667713

668714
message PointGroup {
669715
GroupId id = 1; // Group id
670-
repeated ScoredPoint hits = 2; // Points in the group
716+
repeated ScoredPoint hits = 2; // Points in the group
671717
RetrievedPoint lookup = 3; // Point(s) from the lookup collection that matches the group id
672718
}
673719

@@ -690,6 +736,11 @@ message QueryBatchResponse {
690736
double time = 2; // Time spent to process
691737
}
692738

739+
message QueryGroupsResponse {
740+
GroupsResult result = 1;
741+
double time = 2; // Time spent to process
742+
}
743+
693744
message BatchResult {
694745
repeated ScoredPoint result = 1;
695746
}
@@ -771,12 +822,12 @@ message Filter {
771822
repeated Condition should = 1; // At least one of those conditions should match
772823
repeated Condition must = 2; // All conditions must match
773824
repeated Condition must_not = 3; // All conditions must NOT match
774-
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
825+
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
775826
}
776827

777828
message MinShould {
778-
repeated Condition conditions = 1;
779-
uint64 min_count = 2;
829+
repeated Condition conditions = 1;
830+
uint64 min_count = 2;
780831
}
781832

782833
message Condition {

packages/js-client-grpc/proto/points_service.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,8 @@ service Points {
117117
Universally query points in a batch fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.
118118
*/
119119
rpc QueryBatch (QueryBatchPoints) returns (QueryBatchResponse) {}
120+
/*
121+
Universally query points in a group fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.
122+
*/
123+
rpc QueryGroups (QueryPointGroups) returns (QueryGroupsResponse) {}
120124
}

0 commit comments

Comments
 (0)