Skip to content

Commit c6db7c7

Browse files
JojiiOfficialtimvisee
authored andcommitted
Update protos for Qdrant 1.12, add new endpoints (#189)
* update protos and rust structs * add client functions * use new compile function * recompile protos * trigger recompiling * add examples * add example snippets * Adjust GeoIndexParams and fix warnings when compiling tests
1 parent b437a94 commit c6db7c7

File tree

15 files changed

+1137
-528
lines changed

15 files changed

+1137
-528
lines changed

proto/collections.proto

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,18 @@ enum ShardingMethod {
310310
Custom = 1; // Shard by user-defined key
311311
}
312312

313+
message StrictModeConfig {
314+
optional bool enabled = 1;
315+
optional uint32 max_query_limit = 2;
316+
optional uint32 max_timeout = 3;
317+
optional bool unindexed_filtering_retrieve = 4;
318+
optional bool unindexed_filtering_update = 5;
319+
320+
optional uint32 search_max_hnsw_ef = 6;
321+
optional bool search_allow_exact = 7;
322+
optional float search_max_oversampling = 8;
323+
}
324+
313325
message CreateCollection {
314326
string collection_name = 1; // Name of the collection
315327
reserved 2; // Deprecated
@@ -327,6 +339,7 @@ message CreateCollection {
327339
optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector
328340
optional ShardingMethod sharding_method = 15; // Sharding method
329341
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
342+
optional StrictModeConfig strict_mode_config = 17; // Configuration for strict mode
330343
}
331344

332345
message UpdateCollection {
@@ -376,6 +389,7 @@ message CollectionConfig {
376389
OptimizersConfigDiff optimizer_config = 3; // Configuration of the optimizers
377390
WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log
378391
optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization
392+
optional StrictModeConfig strict_mode_config = 6; // Configuration of strict mode.
379393
}
380394

381395
enum TokenizerType {
@@ -392,8 +406,8 @@ message KeywordIndexParams {
392406
}
393407

394408
message IntegerIndexParams {
395-
bool lookup = 1; // If true - support direct lookups.
396-
bool range = 2; // If true - support ranges filters.
409+
optional bool lookup = 1; // If true - support direct lookups.
410+
optional bool range = 2; // If true - support ranges filters.
397411
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.
398412
optional bool on_disk = 4; // If true - store index on disk.
399413
}
@@ -404,13 +418,15 @@ message FloatIndexParams {
404418
}
405419

406420
message GeoIndexParams {
421+
optional bool on_disk = 1; // If true - store index on disk.
407422
}
408423

409424
message TextIndexParams {
410425
TokenizerType tokenizer = 1; // Tokenizer type
411426
optional bool lowercase = 2; // If true - all tokens will be lowercase
412427
optional uint64 min_token_len = 3; // Minimal token length
413428
optional uint64 max_token_len = 4; // Maximal token length
429+
optional bool on_disk = 5; // If true - store index on disk.
414430
}
415431

416432
message BoolIndexParams {

proto/points.proto

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,17 +589,59 @@ message QueryPointGroups {
589589
optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards
590590
}
591591

592+
message FacetCounts {
593+
string collection_name = 1; // Name of the collection
594+
string key = 2; // Payload key of the facet
595+
optional Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions.
596+
optional uint64 limit = 4; // Max number of facets. Default is 10.
597+
optional bool exact = 5; // If true, return exact counts, slower but useful for debugging purposes. Default is false.
598+
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
599+
optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
600+
optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
601+
}
602+
592603
message FacetValue {
593604
oneof variant {
594605
string string_value = 1; // String value from the facet
606+
int64 integer_value = 2; // Integer value from the facet
607+
bool bool_value = 3; // Boolean value from the facet
595608
}
596609
}
597610

598-
message FacetValueHit {
611+
message FacetHit {
599612
FacetValue value = 1; // Value from the facet
600613
uint64 count = 2; // Number of points with this value
601614
}
602615

616+
message SearchMatrixPoints {
617+
string collection_name = 1; // Name of the collection
618+
optional Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions.
619+
optional uint64 sample = 3; // How many points to select and search within. Default is 10.
620+
optional uint64 limit = 4; // How many neighbours per sample to find. Default is 3.
621+
optional string using = 5; // Define which vector to use for querying. If missing, the default vector is is used.
622+
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
623+
optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
624+
optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
625+
}
626+
627+
message SearchMatrixPairs {
628+
repeated SearchMatrixPair pairs = 1; // List of pairs of points with scores
629+
}
630+
631+
message SearchMatrixPair {
632+
PointId a = 1; // first id of the pair
633+
PointId b = 2; // second id of the pair
634+
float score = 3; // score of the pair
635+
}
636+
637+
message SearchMatrixOffsets {
638+
repeated uint64 offsets_row = 1; // Row indices of the matrix
639+
repeated uint64 offsets_col = 2; // Column indices of the matrix
640+
repeated float scores = 3; // Scores associated with matrix coordinates
641+
repeated PointId ids = 4; // Ids of the points in order
642+
}
643+
644+
603645
message PointsUpdateOperation {
604646
message PointStructList {
605647
repeated PointStruct points = 1;
@@ -814,6 +856,21 @@ message UpdateBatchResponse {
814856
double time = 2; // Time spent to process
815857
}
816858

859+
message FacetResponse {
860+
repeated FacetHit hits = 1;
861+
double time = 2; // Time spent to process
862+
}
863+
864+
message SearchMatrixPairsResponse {
865+
SearchMatrixPairs result = 1;
866+
double time = 2; // Time spent to process
867+
}
868+
869+
message SearchMatrixOffsetsResponse {
870+
SearchMatrixOffsets result = 1;
871+
double time = 2; // Time spent to process
872+
}
873+
817874
// ---------------------------------------------
818875
// ------------- Filter Conditions -------------
819876
// ---------------------------------------------

proto/points_service.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,16 @@ service Points {
121121
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.
122122
*/
123123
rpc QueryGroups (QueryPointGroups) returns (QueryGroupsResponse) {}
124+
/*
125+
Perform facet counts. For each value in the field, count the number of points that have this value and match the conditions.
126+
*/
127+
rpc Facet (FacetCounts) returns (FacetResponse) {}
128+
/*
129+
Compute distance matrix for sampled points with a pair based output format
130+
*/
131+
rpc SearchMatrixPairs (SearchMatrixPoints) returns (SearchMatrixPairsResponse) {}
132+
/*
133+
Compute distance matrix for sampled points with an offset based output format
134+
*/
135+
rpc SearchMatrixOffsets (SearchMatrixPoints) returns (SearchMatrixOffsetsResponse) {}
124136
}

src/builder_ext.rs

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ use crate::qdrant::{
88
DeleteFieldIndexCollectionBuilder, DeletePayloadPointsBuilder, DeletePointVectorsBuilder,
99
DeletePointsBuilder, DeleteShardKey, DeleteShardKeyRequestBuilder,
1010
DeleteSnapshotRequestBuilder, DiscoverBatchPointsBuilder, DiscoverPoints,
11-
DiscoverPointsBuilder, Distance, FieldType, GetPointsBuilder, LookupLocationBuilder,
12-
MoveShardBuilder, PayloadExcludeSelector, PayloadIncludeSelector, PointId, PointStruct,
13-
PointVectors, PointsUpdateOperation, ProductQuantizationBuilder, QuantizationType,
14-
QueryBatchPointsBuilder, QueryPointGroupsBuilder, QueryPoints, QueryPointsBuilder,
15-
RecommendBatchPointsBuilder, RecommendExample, RecommendPointGroupsBuilder, RecommendPoints,
16-
RecommendPointsBuilder, RenameAliasBuilder, ReplicaBuilder, ReplicateShardBuilder,
17-
ScalarQuantizationBuilder, ScrollPointsBuilder, SearchBatchPointsBuilder,
18-
SearchPointGroupsBuilder, SearchPoints, SearchPointsBuilder, SetPayloadPointsBuilder, ShardKey,
19-
UpdateBatchPointsBuilder, UpdateCollectionBuilder, UpdateCollectionClusterSetupRequestBuilder,
20-
UpdatePointVectorsBuilder, UpsertPointsBuilder, Value, VectorParamsBuilder, VectorsSelector,
21-
WithLookupBuilder,
11+
DiscoverPointsBuilder, Distance, FacetCountsBuilder, FieldType, GetPointsBuilder,
12+
LookupLocationBuilder, MoveShardBuilder, PayloadExcludeSelector, PayloadIncludeSelector,
13+
PointId, PointStruct, PointVectors, PointsUpdateOperation, ProductQuantizationBuilder,
14+
QuantizationType, QueryBatchPointsBuilder, QueryPointGroupsBuilder, QueryPoints,
15+
QueryPointsBuilder, RecommendBatchPointsBuilder, RecommendExample, RecommendPointGroupsBuilder,
16+
RecommendPoints, RecommendPointsBuilder, RenameAliasBuilder, ReplicaBuilder,
17+
ReplicateShardBuilder, ScalarQuantizationBuilder, ScrollPointsBuilder,
18+
SearchBatchPointsBuilder, SearchMatrixPointsBuilder, SearchPointGroupsBuilder, SearchPoints,
19+
SearchPointsBuilder, SetPayloadPointsBuilder, ShardKey, UpdateBatchPointsBuilder,
20+
UpdateCollectionBuilder, UpdateCollectionClusterSetupRequestBuilder, UpdatePointVectorsBuilder,
21+
UpsertPointsBuilder, Value, VectorParamsBuilder, VectorsSelector, WithLookupBuilder,
2222
};
2323

2424
impl VectorParamsBuilder {
@@ -545,3 +545,20 @@ impl QueryPointGroupsBuilder {
545545
builder
546546
}
547547
}
548+
549+
impl FacetCountsBuilder {
550+
pub fn new(collection_name: impl Into<String>, key: impl Into<String>) -> FacetCountsBuilder {
551+
let mut builder = Self::empty();
552+
builder.collection_name = Some(collection_name.into());
553+
builder.key = Some(key.into());
554+
builder
555+
}
556+
}
557+
558+
impl SearchMatrixPointsBuilder {
559+
pub fn new(collection_name: impl Into<String>) -> SearchMatrixPointsBuilder {
560+
let mut builder = Self::empty();
561+
builder.collection_name = Some(collection_name.into());
562+
builder
563+
}
564+
}

0 commit comments

Comments
 (0)