Skip to content

Commit

Permalink
update client to v1.11.0 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
generall authored Aug 12, 2024
1 parent 251246c commit 6fb15a4
Show file tree
Hide file tree
Showing 7 changed files with 4,257 additions and 2,859 deletions.
51 changes: 47 additions & 4 deletions proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ enum PayloadSchemaType {
Text = 5;
Bool = 6;
Datetime = 7;
Uuid = 8;
}

enum QuantizationType {
Expand Down Expand Up @@ -384,22 +385,56 @@ enum TokenizerType {
Multilingual = 4;
}

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

message IntegerIndexParams {
bool lookup = 1; // If true - support direct lookups.
bool range = 2; // If true - support ranges filters.
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.
optional bool on_disk = 4; // If true - store index on disk.
}

message FloatIndexParams {
optional bool on_disk = 1; // If true - store index on disk.
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.
}

message GeoIndexParams {
}

message TextIndexParams {
TokenizerType tokenizer = 1; // Tokenizer type
optional bool lowercase = 2; // If true - all tokens will be lowercase
optional uint64 min_token_len = 3; // Minimal token length
optional uint64 max_token_len = 4; // Maximal token length
}

message IntegerIndexParams {
bool lookup = 1; // If true - support direct lookups.
bool range = 2; // If true - support ranges filters.
message BoolIndexParams {
}

message DatetimeIndexParams {
optional bool on_disk = 1; // If true - store index on disk.
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.
}

message UuidIndexParams {
optional bool is_tenant = 1; // If true - used for tenant optimization.
optional bool on_disk = 2; // If true - store index on disk.
}

message PayloadIndexParams {
oneof index_params {
TextIndexParams text_index_params = 1; // Parameters for text index
KeywordIndexParams keyword_index_params = 3; // Parameters for keyword index
IntegerIndexParams integer_index_params = 2; // Parameters for integer index
FloatIndexParams float_index_params = 4; // Parameters for float index
GeoIndexParams geo_index_params = 5; // Parameters for geo index
TextIndexParams text_index_params = 1; // Parameters for text index
BoolIndexParams bool_index_params = 6; // Parameters for bool index
DatetimeIndexParams datetime_index_params = 7; // Parameters for datetime index
UuidIndexParams uuid_index_params = 8; // Parameters for uuid index
}
}

Expand Down Expand Up @@ -510,12 +545,20 @@ message ShardTransferInfo {
bool sync = 4; // If `true` transfer is a synchronization of a replicas; If `false` transfer is a moving of a shard from one peer to another
}

message ReshardingInfo {
uint32 shard_id = 1;
uint64 peer_id = 2;
optional ShardKey shard_key = 3;
}

message CollectionClusterInfoResponse {
uint64 peer_id = 1; // ID of this peer
uint64 shard_count = 2; // Total number of shards
repeated LocalShardInfo local_shards = 3; // Local shards
repeated RemoteShardInfo remote_shards = 4; // Remote shards
repeated ShardTransferInfo shard_transfers = 5; // Shard transfers
// TODO(resharding): enable on release:
// repeated ReshardingInfo resharding_operations = 6; // Resharding operations
}

message MoveShard {
Expand Down
69 changes: 60 additions & 9 deletions proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ message GetPoints {
optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response
optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 7; // Specify in which shards to look for the points, if not specified - look in all shards
optional uint64 timeout = 8; // If set, overrides global timeout setting for this request. Unit is seconds.
}

message UpdatePointVectors {
Expand Down Expand Up @@ -173,6 +174,7 @@ enum FieldType {
FieldTypeText = 4;
FieldTypeBool = 5;
FieldTypeDatetime = 6;
FieldTypeUuid = 7;
}

message CreateFieldIndexCollection {
Expand Down Expand Up @@ -265,7 +267,7 @@ message SearchParams {
optional bool exact = 2;

/*
If set to true, search will ignore quantized vector data
If set to true, search will ignore quantized vector data
*/
optional QuantizationSearchParams quantization = 3;
/*
Expand Down Expand Up @@ -358,16 +360,17 @@ message ScrollPoints {
optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 9; // Specify in which shards to look for the points, if not specified - look in all shards
optional OrderBy order_by = 10; // Order the records by a payload field
optional uint64 timeout = 11; // If set, overrides global timeout setting for this request. Unit is seconds.
}

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

// Uses custom search objective. Each candidate is compared against all
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
// Uses custom search objective. Each candidate is compared against all
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
// If the `max_neg_score` is chosen then it is squared and negated.
BestScore = 1;
}
Expand Down Expand Up @@ -433,7 +436,7 @@ message RecommendPointGroups {
message TargetVector {
oneof target {
VectorExample single = 1;

// leaving extensibility for possibly adding multi-target
}
}
Expand Down Expand Up @@ -480,6 +483,7 @@ message CountPoints {
optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count
optional ReadConsistency read_consistency = 4; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 5; // Specify in which shards to look for the points, if not specified - look in all shards
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
}

message RecommendInput {
Expand All @@ -504,6 +508,16 @@ message ContextInput {

enum Fusion {
RRF = 0; // Reciprocal Rank Fusion
DBSF = 1; // Distribution-Based Score Fusion
}

// Sample points from the collection
//
// Available sampling methods:
//
// * `random` - Random sampling
enum Sample {
Random = 0;
}

message Query {
Expand All @@ -514,6 +528,7 @@ message Query {
ContextInput context = 4; // Return points that live in positive areas.
OrderBy order_by = 5; // Order the points by a payload field.
Fusion fusion = 6; // Fuse the results of multiple prefetches.
Sample sample = 7; // Sample points from the collection.
}
}

Expand Down Expand Up @@ -553,6 +568,37 @@ message QueryBatchPoints {
optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds.
}

message QueryPointGroups {
string collection_name = 1; // Name of the collection
repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs.
optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used.
optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions.
optional SearchParams params = 6; // Search params for when there is no prefetch.
optional float score_threshold = 7; // Return points with scores better than this threshold.
WithPayloadSelector with_payload = 8; // Options for specifying which payload to include or not
optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response
optional LookupLocation lookup_from = 10; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector
optional uint64 limit = 11; // Max number of points. Default is 3.
optional uint64 group_size = 12; // Maximum amount of points to return per group. Default to 10.
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.
optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection
optional uint64 timeout = 16; // If set, overrides global timeout setting for this request. Unit is seconds.
optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards
}

message FacetValue {
oneof variant {
string string_value = 1; // String value from the facet
}
}

message FacetValueHit {
FacetValue value = 1; // Value from the facet
uint64 count = 2; // Number of points with this value
}

message PointsUpdateOperation {
message PointStructList {
repeated PointStruct points = 1;
Expand Down Expand Up @@ -666,7 +712,7 @@ message GroupId {

message PointGroup {
GroupId id = 1; // Group id
repeated ScoredPoint hits = 2; // Points in the group
repeated ScoredPoint hits = 2; // Points in the group
RetrievedPoint lookup = 3; // Point(s) from the lookup collection that matches the group id
}

Expand All @@ -689,6 +735,11 @@ message QueryBatchResponse {
double time = 2; // Time spent to process
}

message QueryGroupsResponse {
GroupsResult result = 1;
double time = 2; // Time spent to process
}

message BatchResult {
repeated ScoredPoint result = 1;
}
Expand Down Expand Up @@ -770,12 +821,12 @@ message Filter {
repeated Condition should = 1; // At least one of those conditions should match
repeated Condition must = 2; // All conditions must match
repeated Condition must_not = 3; // All conditions must NOT match
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
}

message MinShould {
repeated Condition conditions = 1;
uint64 min_count = 2;
repeated Condition conditions = 1;
uint64 min_count = 2;
}

message Condition {
Expand Down
4 changes: 4 additions & 0 deletions proto/points_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,8 @@ service Points {
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.
*/
rpc QueryBatch (QueryBatchPoints) returns (QueryBatchResponse) {}
/*
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.
*/
rpc QueryGroups (QueryPointGroups) returns (QueryGroupsResponse) {}
}
Loading

0 comments on commit 6fb15a4

Please sign in to comment.