Skip to content

Commit a5a5d2b

Browse files
Anush008timviseeagourlay
authored
v1.16.0 (#92)
* 1.16.0 regen Signed-off-by: Anush008 <[email protected]> * BRANCH=dev sh internal/tools/sync_proto.sh Signed-off-by: Anush008 <[email protected]> * regen Signed-off-by: Anush008 <[email protected]> * regen Signed-off-by: Anush008 <[email protected]> * 1.16.0: Part 2 (#93) * refactor: Update to use new vector fields Signed-off-by: Anush008 <[email protected]> * feat: VectorOutput parser Signed-off-by: Anush008 <[email protected]> * chore: NewMatchTextAny Signed-off-by: Anush008 <[email protected]> * feat: Added new RRF Query helper. Signed-off-by: Anush008 <[email protected]> --------- Signed-off-by: Anush008 <[email protected]> * Make sync script compatible with Linux and macOS flavors of sed * Bump proto definitions * bump test container version * chore: Re-gen due qdrant/qdrant#7536 Signed-off-by: Anush008 <[email protected]> * feat: Expose Collection cluster setup ops to high-level client Signed-off-by: Anush008 <[email protected]> --------- Signed-off-by: Anush008 <[email protected]> Co-authored-by: timvisee <[email protected]> Co-authored-by: Arnaud Gourlay <[email protected]>
1 parent fe6ddaf commit a5a5d2b

22 files changed

+8173
-7143
lines changed

internal/proto/collections.proto

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ syntax = "proto3";
22
package qdrant;
33

44

5+
import "json_with_int.proto";
6+
import "common.proto";
7+
58
enum Datatype {
69
Default = 0;
710
Float32 = 1;
811
Uint8 = 2;
912
Float16 = 3;
1013
}
1114

15+
// ---------------------------------------------
16+
// ------------- Collection Config -------------
17+
// ---------------------------------------------
18+
1219
message VectorParams {
1320
uint64 size = 1; // Size of the vectors
1421
Distance distance = 2; // Distance function used for comparing vectors
@@ -159,6 +166,10 @@ message OptimizerStatus {
159166
string error = 2;
160167
}
161168

169+
message CollectionWarning {
170+
string message = 1;
171+
}
172+
162173
message HnswConfigDiff {
163174
/*
164175
Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.
@@ -169,10 +180,12 @@ message HnswConfigDiff {
169180
*/
170181
optional uint64 ef_construct = 2;
171182
/*
172-
Minimal size (in KiloBytes) of vectors for additional payload-based indexing.
173-
If the payload chunk is smaller than `full_scan_threshold` additional indexing won't be used -
174-
in this case full-scan search should be preferred by query planner and additional indexing is not required.
175-
Note: 1 Kb = 1 vector of size 256
183+
Minimal size threshold (in KiloBytes) below which full-scan is preferred over HNSW search.
184+
This measures the total size of vectors being queried against.
185+
When the maximum estimated amount of points that a condition satisfies is smaller than
186+
`full_scan_threshold`, the query planner will use full-scan search instead of HNSW index
187+
traversal for better performance.
188+
Note: 1Kb = 1 vector of size 256
176189
*/
177190
optional uint64 full_scan_threshold = 3;
178191
/*
@@ -190,6 +203,13 @@ message HnswConfigDiff {
190203
Number of additional payload-aware links per node in the index graph. If not set - regular M parameter will be used.
191204
*/
192205
optional uint64 payload_m = 6;
206+
/*
207+
Store copies of original and quantized vectors within the HNSW index file. Default: false.
208+
Enabling this option will trade the search speed for disk usage by reducing amount of
209+
random seeks during the search.
210+
Requires quantized vectors to be enabled. Multi-vectors are not supported.
211+
*/
212+
optional bool inline_storage = 7;
193213
}
194214

195215
message SparseIndexConfig {
@@ -211,6 +231,7 @@ message SparseIndexConfig {
211231
message WalConfigDiff {
212232
optional uint64 wal_capacity_mb = 1; // Size of a single WAL block file
213233
optional uint64 wal_segments_ahead = 2; // Number of segments to create in advance
234+
optional uint64 wal_retain_closed = 3; // Number of closed segments to retain
214235
}
215236

216237
message OptimizersConfigDiff {
@@ -349,41 +370,41 @@ enum ShardingMethod {
349370
}
350371

351372
message StrictModeConfig {
352-
optional bool enabled = 1;
353-
optional uint32 max_query_limit = 2;
354-
optional uint32 max_timeout = 3;
355-
optional bool unindexed_filtering_retrieve = 4;
356-
optional bool unindexed_filtering_update = 5;
357-
358-
optional uint32 search_max_hnsw_ef = 6;
359-
optional bool search_allow_exact = 7;
360-
optional float search_max_oversampling = 8;
361-
optional uint64 upsert_max_batchsize = 9;
362-
optional uint64 max_collection_vector_size_bytes = 10;
373+
optional bool enabled = 1; // Whether strict mode is enabled for a collection or not.
374+
optional uint32 max_query_limit = 2; // Max allowed `limit` parameter for all APIs that don't have their own max limit.
375+
optional uint32 max_timeout = 3; // Max allowed `timeout` parameter.
376+
optional bool unindexed_filtering_retrieve = 4; // Allow usage of unindexed fields in retrieval based (e.g. search) filters.
377+
optional bool unindexed_filtering_update = 5; // Allow usage of unindexed fields in filtered updates (e.g. delete by payload).
378+
optional uint32 search_max_hnsw_ef = 6; // Max HNSW ef value allowed in search parameters.
379+
optional bool search_allow_exact = 7; // Whether exact search is allowed.
380+
optional float search_max_oversampling = 8; // Max oversampling value allowed in search
381+
optional uint64 upsert_max_batchsize = 9; // Max batchsize when upserting
382+
optional uint64 max_collection_vector_size_bytes = 10; // Max size of a collections vector storage in bytes, ignoring replicas.
363383
optional uint32 read_rate_limit = 11; // Max number of read operations per minute per replica
364384
optional uint32 write_rate_limit = 12; // Max number of write operations per minute per replica
365-
optional uint64 max_collection_payload_size_bytes = 13;
366-
optional uint64 filter_max_conditions = 14;
367-
optional uint64 condition_max_size = 15;
368-
optional StrictModeMultivectorConfig multivector_config = 16;
369-
optional StrictModeSparseConfig sparse_config = 17;
370-
optional uint64 max_points_count = 18;
385+
optional uint64 max_collection_payload_size_bytes = 13; // Max size of a collections payload storage in bytes, ignoring replicas.
386+
optional uint64 filter_max_conditions = 14; // Max conditions a filter can have.
387+
optional uint64 condition_max_size = 15; // Max size of a condition, eg. items in `MatchAny`.
388+
optional StrictModeMultivectorConfig multivector_config = 16; // Multivector strict mode configuration
389+
optional StrictModeSparseConfig sparse_config = 17; // Sparse vector strict mode configuration
390+
optional uint64 max_points_count = 18; // Max number of points estimated in a collection
391+
optional uint64 max_payload_index_count = 19; // Max number of payload indexes in a collection
371392
}
372393

373394
message StrictModeSparseConfig {
374395
map<string, StrictModeSparse> sparse_config = 1;
375396
}
376397

377398
message StrictModeSparse {
378-
optional uint64 max_length = 10;
399+
optional uint64 max_length = 10; // Max length of sparse vector
379400
}
380401

381402
message StrictModeMultivectorConfig {
382403
map<string, StrictModeMultivector> multivector_config = 1;
383404
}
384405

385406
message StrictModeMultivector {
386-
optional uint64 max_vectors = 1;
407+
optional uint64 max_vectors = 1; // Max number of vectors in a multivector
387408
}
388409

389410
message CreateCollection {
@@ -399,11 +420,12 @@ message CreateCollection {
399420
optional VectorsConfig vectors_config = 10; // Configuration for vectors
400421
optional uint32 replication_factor = 11; // Number of replicas of each shard that network tries to maintain, default = 1
401422
optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1
402-
optional string init_from_collection = 13; // Deprecated: specify name of the other collection to copy data from
423+
reserved 13; // Deprecated: init_from
403424
optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector
404425
optional ShardingMethod sharding_method = 15; // Sharding method
405426
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
406427
optional StrictModeConfig strict_mode_config = 17; // Configuration for strict mode
428+
map<string, Value> metadata = 18; // Arbitrary JSON metadata for the collection
407429
}
408430

409431
message UpdateCollection {
@@ -416,6 +438,7 @@ message UpdateCollection {
416438
optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector
417439
optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters
418440
optional StrictModeConfig strict_mode_config = 9; // New strict mode configuration
441+
map<string, Value> metadata = 10; // Arbitrary JSON-like metadata for the collection, will be merged with already stored metadata
419442
}
420443

421444
message DeleteCollection {
@@ -455,6 +478,7 @@ message CollectionConfig {
455478
WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log
456479
optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization
457480
optional StrictModeConfig strict_mode_config = 6; // Configuration of strict mode.
481+
map<string, Value> metadata = 7; // Arbitrary JSON metadata for the collection
458482
}
459483

460484
enum TokenizerType {
@@ -500,6 +524,7 @@ message TextIndexParams {
500524
optional StopwordsSet stopwords = 6; // Stopwords for the text index
501525
optional bool phrase_matching = 7; // If true - support phrase matching.
502526
optional StemmingAlgorithm stemmer = 8; // Set an algorithm for stemming.
527+
optional bool ascii_folding = 9; // If true, normalize tokens by folding accented characters to ASCII (e.g., "ação" -> "acao"). Default: false.
503528
}
504529

505530
message StemmingAlgorithm {
@@ -548,14 +573,15 @@ message PayloadSchemaInfo {
548573
message CollectionInfo {
549574
CollectionStatus status = 1; // operating condition of the collection
550575
OptimizerStatus optimizer_status = 2; // status of collection optimizers
551-
optional uint64 vectors_count = 3; // Approximate number of vectors in the collection
576+
reserved 3; // Deprecated
552577
uint64 segments_count = 4; // Number of independent segments
553578
reserved 5; // Deprecated
554579
reserved 6; // Deprecated
555580
CollectionConfig config = 7; // Configuration
556581
map<string, PayloadSchemaInfo> payload_schema = 8; // Collection data types
557582
optional uint64 points_count = 9; // Approximate number of points in the collection
558583
optional uint64 indexed_vectors_count = 10; // Approximate number of indexed vectors in the collection.
584+
repeated CollectionWarning warnings = 11; // Warnings related to the collection
559585
}
560586

561587
message ChangeAliases {
@@ -615,6 +641,7 @@ enum ReplicaState {
615641
Recovery = 6; // Shard is undergoing recovered by an external node; Normally rejects updates, accepts updates if force is true
616642
Resharding = 7; // Points are being migrated to this shard as part of scale-up resharding
617643
ReshardingScaleDown = 8; // Points are being migrated to this shard as part of scale-down resharding
644+
ActiveRead = 9; // Active for readers, Partial for writers
618645
}
619646

620647
message ShardKey {
@@ -701,6 +728,12 @@ message RestartTransfer {
701728
ShardTransferMethod method = 4;
702729
}
703730

731+
message ReplicatePoints {
732+
ShardKey from_shard_key = 1; // Source shard key
733+
ShardKey to_shard_key = 2; // Target shard key
734+
optional Filter filter = 3; // If set - only points matching the filter will be replicated
735+
}
736+
704737
enum ShardTransferMethod {
705738
StreamRecords = 0; // Stream shard records in batches
706739
Snapshot = 1; // Snapshot the shard and recover it on the target peer
@@ -718,6 +751,7 @@ message CreateShardKey {
718751
optional uint32 shards_number = 2; // Number of shards to create per shard key
719752
optional uint32 replication_factor = 3; // Number of replicas of each shard to create
720753
repeated uint64 placement = 4; // List of peer ids, allowed to create shards. If empty - all peers are allowed
754+
optional ReplicaState initial_state = 5; // Initial state of created replicas. Warning: use with care.
721755
}
722756

723757
message DeleteShardKey {
@@ -734,6 +768,7 @@ message UpdateCollectionClusterSetupRequest {
734768
CreateShardKey create_shard_key = 7;
735769
DeleteShardKey delete_shard_key = 8;
736770
RestartTransfer restart_transfer = 9;
771+
ReplicatePoints replicate_points = 10;
737772
}
738773
optional uint64 timeout = 6; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied
739774
}

internal/proto/common.proto

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
syntax = "proto3";
2+
package qdrant;
3+
4+
5+
import "google/protobuf/timestamp.proto";
6+
7+
message PointId {
8+
oneof point_id_options {
9+
uint64 num = 1; // Numerical ID of the point
10+
string uuid = 2; // UUID
11+
}
12+
}
13+
14+
message GeoPoint {
15+
double lon = 1;
16+
double lat = 2;
17+
}
18+
19+
message Filter {
20+
repeated Condition should = 1; // At least one of those conditions should match
21+
repeated Condition must = 2; // All conditions must match
22+
repeated Condition must_not = 3; // All conditions must NOT match
23+
optional MinShould min_should = 4; // At least minimum amount of given conditions should match
24+
}
25+
26+
message MinShould {
27+
repeated Condition conditions = 1;
28+
uint64 min_count = 2;
29+
}
30+
31+
message Condition {
32+
oneof condition_one_of {
33+
FieldCondition field = 1;
34+
IsEmptyCondition is_empty = 2;
35+
HasIdCondition has_id = 3;
36+
Filter filter = 4;
37+
IsNullCondition is_null = 5;
38+
NestedCondition nested = 6;
39+
HasVectorCondition has_vector = 7;
40+
}
41+
}
42+
43+
message IsEmptyCondition {
44+
string key = 1;
45+
}
46+
47+
message IsNullCondition {
48+
string key = 1;
49+
}
50+
51+
message HasIdCondition {
52+
repeated PointId has_id = 1;
53+
}
54+
55+
message HasVectorCondition {
56+
string has_vector = 1;
57+
}
58+
59+
message NestedCondition {
60+
string key = 1; // Path to nested object
61+
Filter filter = 2; // Filter condition
62+
}
63+
64+
message FieldCondition {
65+
string key = 1;
66+
Match match = 2; // Check if point has field with a given value
67+
Range range = 3; // Check if points value lies in a given range
68+
GeoBoundingBox geo_bounding_box = 4; // Check if points geolocation lies in a given area
69+
GeoRadius geo_radius = 5; // Check if geo point is within a given radius
70+
ValuesCount values_count = 6; // Check number of values for a specific field
71+
GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon
72+
DatetimeRange datetime_range = 8; // Check if datetime is within a given range
73+
optional bool is_empty = 9; // Check if field is empty
74+
optional bool is_null = 10; // Check if field is null
75+
}
76+
77+
message Match {
78+
oneof match_value {
79+
string keyword = 1; // Match string keyword
80+
int64 integer = 2; // Match integer
81+
bool boolean = 3; // Match boolean
82+
string text = 4; // Match text
83+
RepeatedStrings keywords = 5; // Match multiple keywords
84+
RepeatedIntegers integers = 6; // Match multiple integers
85+
RepeatedIntegers except_integers = 7; // Match any other value except those integers
86+
RepeatedStrings except_keywords = 8; // Match any other value except those keywords
87+
string phrase = 9; // Match phrase text
88+
string text_any = 10; // Match any word in the text
89+
}
90+
}
91+
92+
message RepeatedStrings {
93+
repeated string strings = 1;
94+
}
95+
96+
message RepeatedIntegers {
97+
repeated int64 integers = 1;
98+
}
99+
100+
message Range {
101+
optional double lt = 1;
102+
optional double gt = 2;
103+
optional double gte = 3;
104+
optional double lte = 4;
105+
}
106+
107+
message DatetimeRange {
108+
optional google.protobuf.Timestamp lt = 1;
109+
optional google.protobuf.Timestamp gt = 2;
110+
optional google.protobuf.Timestamp gte = 3;
111+
optional google.protobuf.Timestamp lte = 4;
112+
}
113+
114+
message GeoBoundingBox {
115+
GeoPoint top_left = 1; // north-west corner
116+
GeoPoint bottom_right = 2; // south-east corner
117+
}
118+
119+
message GeoRadius {
120+
GeoPoint center = 1; // Center of the circle
121+
float radius = 2; // In meters
122+
}
123+
124+
message GeoLineString {
125+
repeated GeoPoint points = 1; // Ordered sequence of GeoPoints representing the line
126+
}
127+
128+
// For a valid GeoPolygon, both the exterior and interior GeoLineStrings must consist of a minimum of 4 points.
129+
// Additionally, the first and last points of each GeoLineString must be the same.
130+
message GeoPolygon {
131+
GeoLineString exterior = 1; // The exterior line bounds the surface
132+
repeated GeoLineString interiors = 2; // Interior lines (if present) bound holes within the surface
133+
}
134+
135+
message ValuesCount {
136+
optional uint64 lt = 1;
137+
optional uint64 gt = 2;
138+
optional uint64 gte = 3;
139+
optional uint64 lte = 4;
140+
}

0 commit comments

Comments
 (0)