Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package qdrant;

option csharp_namespace = "Qdrant.Client.Grpc";

import "json_with_int.proto";

enum Datatype {
Default = 0;
Float32 = 1;
Expand Down Expand Up @@ -170,10 +172,12 @@ message HnswConfigDiff {
*/
optional uint64 ef_construct = 2;
/*
Minimal size (in KiloBytes) of vectors for additional payload-based indexing.
If the payload chunk is smaller than `full_scan_threshold` additional indexing won't be used -
in this case full-scan search should be preferred by query planner and additional indexing is not required.
Note: 1 Kb = 1 vector of size 256
Minimal size threshold (in KiloBytes) below which full-scan is preferred over HNSW search.
This measures the total size of vectors being queried against.
When the maximum estimated amount of points that a condition satisfies is smaller than
`full_scan_threshold`, the query planner will use full-scan search instead of HNSW index
traversal for better performance.
Note: 1Kb = 1 vector of size 256
*/
optional uint64 full_scan_threshold = 3;
/*
Expand Down Expand Up @@ -212,6 +216,7 @@ message SparseIndexConfig {
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
optional uint64 wal_retain_closed = 3; // Number of closed segments to retain
}

message OptimizersConfigDiff {
Expand Down Expand Up @@ -405,6 +410,7 @@ message CreateCollection {
optional ShardingMethod sharding_method = 15; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
optional StrictModeConfig strict_mode_config = 17; // Configuration for strict mode
map<string, Value> metadata = 18; // Arbitrary JSON metadata for the collection
}

message UpdateCollection {
Expand All @@ -417,6 +423,7 @@ message UpdateCollection {
optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector
optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters
optional StrictModeConfig strict_mode_config = 9; // New strict mode configuration
map<string, Value> metadata = 10; // Arbitrary JSON-like metadata for the collection, will be merged with already stored metadata
}

message DeleteCollection {
Expand Down Expand Up @@ -456,6 +463,7 @@ message CollectionConfig {
WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log
optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization
optional StrictModeConfig strict_mode_config = 6; // Configuration of strict mode.
map<string, Value> metadata = 7; // Arbitrary JSON metadata for the collection
}

enum TokenizerType {
Expand Down
16 changes: 14 additions & 2 deletions proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ message UpsertPoints {
repeated PointStruct points = 3;
optional WriteOrdering ordering = 4; // Write ordering guarantees
optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys
optional Filter update_filter = 6; // If specified, only points that match this filter will be updated, others will be inserted
}

message DeletePoints {
Expand Down Expand Up @@ -162,6 +163,7 @@ message UpdatePointVectors {
repeated PointVectors points = 3; // List of points and vectors to update
optional WriteOrdering ordering = 4; // Write ordering guarantees
optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys
optional Filter update_filter = 6; // If specified, only points that match this filter will be updated
}

message PointVectors {
Expand Down Expand Up @@ -563,7 +565,7 @@ message ContextInput {
}

enum Fusion {
RRF = 0; // Reciprocal Rank Fusion
RRF = 0; // Reciprocal Rank Fusion (with default parameters)
DBSF = 1; // Distribution-Based Score Fusion
}

Expand Down Expand Up @@ -636,7 +638,7 @@ message DecayParamsExpression {
optional Expression target = 2;
// The scale factor of the decay, in terms of `x`. Defaults to 1.0. Must be a non-zero positive number.
optional float scale = 3;
// The midpoint of the decay. Defaults to 0.5. Output will be this value when `|x - target| == scale`.
// The midpoint of the decay. Should be between 0 and 1. Defaults to 0.5. Output will be this value when `|x - target| == scale`.
optional float midpoint = 4;
}

Expand Down Expand Up @@ -667,6 +669,11 @@ message Mmr {
optional uint32 candidates_limit = 3;
}

// Parameterized reciprocal rank fusion
message Rrf {
optional uint32 k = 1; // K parameter for reciprocal rank fusion
}

message Query {
oneof variant {
VectorInput nearest = 1; // Find the nearest neighbors to this vector.
Expand All @@ -678,6 +685,7 @@ message Query {
Sample sample = 7; // Sample points from the collection.
Formula formula = 8; // Score boosting via an arbitrary formula
NearestInputWithMmr nearest_with_mmr = 9; // Search nearest neighbors, but re-rank based on the Maximal Marginal Relevance algorithm.
Rrf rrf = 10; // Parameterized reciprocal rank fusion
}
}

Expand Down Expand Up @@ -794,6 +802,7 @@ message PointsUpdateOperation {
message PointStructList {
repeated PointStruct points = 1;
optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys
optional Filter update_filter = 3; // If specified, only points that match this filter will be updated, others will be inserted
}
message SetPayload {
map<string, Value> payload = 1;
Expand All @@ -815,6 +824,7 @@ message PointsUpdateOperation {
message UpdateVectors {
repeated PointVectors points = 1; // List of points and vectors to update
optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys
optional Filter update_filter = 3; // If specified, only points that match this filter will be updated
}
message DeleteVectors {
PointsSelector points_selector = 1; // Affected points
Expand Down Expand Up @@ -1023,6 +1033,7 @@ message UpdateBatchResponse {
message FacetResponse {
repeated FacetHit hits = 1;
double time = 2; // Time spent to process
optional Usage usage = 3;
}

message SearchMatrixPairsResponse {
Expand Down Expand Up @@ -1110,6 +1121,7 @@ message Match {
RepeatedIntegers except_integers = 7; // Match any other value except those integers
RepeatedStrings except_keywords = 8; // Match any other value except those keywords
string phrase = 9; // Match phrase text
string text_any = 10; // Match any word in the text
}
}

Expand Down
1 change: 1 addition & 0 deletions src/builders/create_collection_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl CreateCollectionBuilder {
Some(value) => value,
None => core::default::Default::default(),
},
metadata: Default::default(),
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand Down
1 change: 1 addition & 0 deletions src/builders/update_collection_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ impl UpdateCollectionBuilder {
quantization_config: { convert_option(&self.quantization_config) },
sparse_vectors_config: self.sparse_vectors_config.unwrap_or_default(),
strict_mode_config: self.strict_mode_config.unwrap_or_default(),
metadata: Default::default(),
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand Down
1 change: 1 addition & 0 deletions src/builders/update_point_vectors_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl UpdatePointVectorsBuilder {
},
ordering: self.ordering.unwrap_or_default(),
shard_key_selector: self.shard_key_selector.unwrap_or_default(),
update_filter: None,
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand Down
1 change: 1 addition & 0 deletions src/builders/upsert_points_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl UpsertPointsBuilder {
},
ordering: self.ordering.unwrap_or_default(),
shard_key_selector: self.shard_key_selector.unwrap_or_default(),
update_filter: None,
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand Down
1 change: 1 addition & 0 deletions src/builders/wal_config_diff_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ impl WalConfigDiffBuilder {
Ok(WalConfigDiff {
wal_capacity_mb: self.wal_capacity_mb.unwrap_or_default(),
wal_segments_ahead: self.wal_segments_ahead.unwrap_or_default(),
wal_retain_closed: None,
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand Down
1 change: 1 addition & 0 deletions src/client/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ impl QdrantClient {
vectors_config: vectors_config.cloned(),
quantization_config: quantization_config.cloned(),
strict_mode_config: None,
metadata: Default::default(),
})
.await?;

Expand Down
3 changes: 3 additions & 0 deletions src/client/points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ impl QdrantClient {
points: points.to_vec(),
ordering: ordering_ref.cloned(),
shard_key_selector: shard_keys_ref.clone(),
update_filter: None,
})
.await?
.into_inner())
Expand Down Expand Up @@ -278,6 +279,7 @@ impl QdrantClient {
points: chunk.to_vec(),
ordering: ordering_ref.cloned(),
shard_key_selector: shard_keys_ref.clone(),
update_filter: None,
})
.await?
.into_inner();
Expand Down Expand Up @@ -925,6 +927,7 @@ impl QdrantClient {
points: points.to_owned(),
ordering: ordering_ref.cloned(),
shard_key_selector: shard_keys_ref.clone(),
update_filter: None,
})
.await?;
Ok(result.into_inner())
Expand Down
3 changes: 3 additions & 0 deletions src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ impl std::ops::Not for MatchValue {
Self::Phrase(_) => {
panic!("cannot negate a MatchValue::Phrase, use within must_not clause instead")
}
Self::TextAny(_) => {
panic!("cannot negate a MatchValue::TextAny, use within must_not clause instead")
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/manual_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub mod points_update_operation {
Ok(PointStructList {
points: builder.points,
shard_key_selector: builder.shard_key_selector,
update_filter: None,
})
}
}
Expand Down Expand Up @@ -248,6 +249,7 @@ pub mod points_update_operation {
Ok(UpdateVectors {
points: builder.points,
shard_key_selector: builder.shard_key_selector,
update_filter: None,
})
}
}
Expand Down
Loading