Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v1.7.0 #80

Merged
merged 15 commits into from
Dec 4, 2023
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ anyhow = "1"
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
reqwest = { version = "0.11.22", optional = true, default-features = false, features = ["stream", "rustls-tls"] }
futures-util = { version = "0.3.28", optional = true }
futures-util = { version = "0.3.29", optional = true }

[dev-dependencies]
tonic-build = { version = "0.9.2", features = ["prost"] }
tokio = { version = "1.32.0", features = ["rt-multi-thread"] }
tokio = { version = "1.34.0", features = ["rt-multi-thread"] }

[features]
default = ["download_snapshots", "serde"]
Expand Down
81 changes: 81 additions & 0 deletions proto/collections.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";
package qdrant;
option csharp_namespace = "Qdrant.Client.Grpc";

message VectorParams {
uint64 size = 1; // Size of the vectors
Expand Down Expand Up @@ -37,6 +38,14 @@ message VectorsConfigDiff {
}
}

message SparseVectorParams {
optional SparseIndexConfig index = 1; // Configuration of sparse index
}

message SparseVectorConfig {
map<string, SparseVectorParams> map = 1;
}

message GetCollectionInfoRequest {
string collection_name = 1; // Name of the collection
}
Expand All @@ -63,6 +72,7 @@ enum Distance {
Cosine = 1;
Euclid = 2;
Dot = 3;
Manhattan = 4;
}

enum CollectionStatus {
Expand Down Expand Up @@ -130,6 +140,18 @@ message HnswConfigDiff {
optional uint64 payload_m = 6;
}

message SparseIndexConfig {
/*
Prefer a full scan search upto (excluding) this number of vectors.
Note: this is number of vectors, not KiloBytes.
*/
optional uint64 full_scan_threshold = 1;
/*
Store inverted index on disk. If set to false, the index will be stored in RAM.
*/
optional bool on_disk = 2;
}

message WalConfigDiff {
optional uint64 wal_capacity_mb = 1; // Size of a single WAL block file
optional uint64 wal_segments_ahead = 2; // Number of segments to create in advance
Expand Down Expand Up @@ -233,6 +255,11 @@ message QuantizationConfigDiff {
}
}

enum ShardingMethod {
Auto = 0; // Auto-sharding based on record ids
Custom = 1; // Shard by user-defined key
}

message CreateCollection {
string collection_name = 1; // Name of the collection
reserved 2; // Deprecated
Expand All @@ -248,6 +275,8 @@ message CreateCollection {
optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1
optional string init_from_collection = 13; // Specify name of the other collection to copy data from
optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector
optional ShardingMethod sharding_method = 15; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
}

message UpdateCollection {
Expand All @@ -258,6 +287,7 @@ message UpdateCollection {
optional HnswConfigDiff hnsw_config = 5; // New HNSW parameters for the collection index
optional VectorsConfigDiff vectors_config = 6; // New vector parameters
optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector
optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters
}

message DeleteCollection {
Expand All @@ -279,6 +309,8 @@ message CollectionParams {
optional uint32 replication_factor = 6; // Number of replicas of each shard that network tries to maintain
optional uint32 write_consistency_factor = 7; // How many replicas should apply the operation for us to consider it successful
optional uint32 read_fan_out_factor = 8; // Fan-out every read request to these many additional remote nodes (and return first available response)
optional ShardingMethod sharding_method = 9; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 10; // Configuration for sparse vectors
}

message CollectionParamsDiff {
Expand Down Expand Up @@ -390,18 +422,28 @@ enum ReplicaState {
Partial = 2; // The shard is partially loaded and is currently receiving data from other shards
Initializing = 3; // Collection is being created
Listener = 4; // A shard which receives data, but is not used for search; Useful for backup shards
PartialSnapshot = 5; // Snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard
}

message ShardKey {
oneof key {
string keyword = 1; // String key
uint64 number = 2; // Number key
}
}

message LocalShardInfo {
uint32 shard_id = 1; // Local shard id
uint64 points_count = 2; // Number of points in the shard
ReplicaState state = 3; // Is replica active
optional ShardKey shard_key = 4; // User-defined shard key
}

message RemoteShardInfo {
uint32 shard_id = 1; // Local shard id
uint64 peer_id = 2; // Remote peer id
ReplicaState state = 3; // Is replica active
optional ShardKey shard_key = 4; // User-defined shard key
}

message ShardTransferInfo {
Expand All @@ -423,24 +465,63 @@ message MoveShard {
uint32 shard_id = 1; // Local shard id
uint64 from_peer_id = 2;
uint64 to_peer_id = 3;
optional ShardTransferMethod method = 4;
}

enum ShardTransferMethod {
StreamRecords = 0;
Snapshot = 1;
}

message Replica {
uint32 shard_id = 1;
uint64 peer_id = 2;
}

message CreateShardKey {
ShardKey shard_key = 1; // User-defined shard key
optional uint32 shards_number = 2; // Number of shards to create per shard key
optional uint32 replication_factor = 3; // Number of replicas of each shard to create
repeated uint64 placement = 4; // List of peer ids, allowed to create shards. If empty - all peers are allowed
}

message DeleteShardKey {
ShardKey shard_key = 1; // Shard key to delete
}

message UpdateCollectionClusterSetupRequest {
string collection_name = 1; // Name of the collection
oneof operation {
MoveShard move_shard = 2;
MoveShard replicate_shard = 3;
MoveShard abort_transfer = 4;
Replica drop_replica = 5;
CreateShardKey create_shard_key = 7;
DeleteShardKey delete_shard_key = 8;
}
optional uint64 timeout = 6; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
}

message UpdateCollectionClusterSetupResponse {
bool result = 1;
}

message CreateShardKeyRequest {
string collection_name = 1; // Name of the collection
CreateShardKey request = 2; // Request to create shard key
optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
}

message DeleteShardKeyRequest {
string collection_name = 1; // Name of the collection
DeleteShardKey request = 2; // Request to delete shard key
optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
}

message CreateShardKeyResponse {
bool result = 1;
}

message DeleteShardKeyResponse {
bool result = 1;
}
9 changes: 9 additions & 0 deletions proto/collections_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
import "collections.proto";

package qdrant;
option csharp_namespace = "Qdrant.Client.Grpc";

service Collections {
/*
Expand Down Expand Up @@ -45,4 +46,12 @@ service Collections {
Update cluster setup for a collection
*/
rpc UpdateCollectionClusterSetup (UpdateCollectionClusterSetupRequest) returns (UpdateCollectionClusterSetupResponse) {}
/*
Create shard key
*/
rpc CreateShardKey (CreateShardKeyRequest) returns (CreateShardKeyResponse) {}
/*
Delete shard key
*/
rpc DeleteShardKey (DeleteShardKeyRequest) returns (DeleteShardKeyResponse) {}
}
1 change: 1 addition & 0 deletions proto/json_with_int.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
syntax = "proto3";

package qdrant;
option csharp_namespace = "Qdrant.Client.Grpc";

// `Struct` represents a structured data value, consisting of fields
// which map to dynamically typed values. In some languages, `Struct`
Expand Down
Loading
Loading