Skip to content

Commit 86d1dff

Browse files
authored
Merge pull request #25 from qdrant/update-1.1.0
Update to 1.1.0
2 parents 8021071 + 9865197 commit 86d1dff

File tree

5 files changed

+142
-3
lines changed

5 files changed

+142
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "qdrant-client"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
edition = "2021"
55
authors = ["Qdrant Team <team@qdrant.com>"]
66
description = "Rust client for Qdrant Vector Search Engine"

proto/collections.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ enum PayloadSchemaType {
6161
Text = 5;
6262
}
6363

64+
enum QuantizationType {
65+
UnknownQuantization = 0;
66+
Int8 = 1;
67+
}
68+
6469
message OptimizerStatus {
6570
bool ok = 1;
6671
string error = 2;
@@ -154,6 +159,18 @@ message OptimizersConfigDiff {
154159
optional uint64 max_optimization_threads = 8;
155160
}
156161

162+
message ScalarQuantization {
163+
QuantizationType type = 1; // Type of quantization
164+
optional float quantile = 2; // Number of bits to use for quantization
165+
optional bool always_ram = 3; // If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
166+
}
167+
168+
message QuantizationConfig {
169+
oneof quantization {
170+
ScalarQuantization scalar = 1;
171+
}
172+
}
173+
157174
message CreateCollection {
158175
string collection_name = 1; // Name of the collection
159176
reserved 2; // Deprecated
@@ -168,6 +185,7 @@ message CreateCollection {
168185
optional uint32 replication_factor = 11; // Number of replicas of each shard that network tries to maintain, default = 1
169186
optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1
170187
optional string init_from_collection = 13; // Specify name of the other collection to copy data from
188+
optional QuantizationConfig quantization_config = 14;
171189
}
172190

173191
message UpdateCollection {
@@ -207,6 +225,7 @@ message CollectionConfig {
207225
HnswConfigDiff hnsw_config = 2; // Configuration of vector index
208226
OptimizersConfigDiff optimizer_config = 3; // Configuration of the optimizers
209227
WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log
228+
optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization
210229
}
211230

212231
enum TokenizerType {

proto/points.proto

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ message WithVectorsSelector {
158158
}
159159
}
160160

161+
message QuantizationSearchParams {
162+
/*
163+
If set to true, search will ignore quantized vector data
164+
*/
165+
optional bool ignore = 1;
166+
167+
/*
168+
If true, use original vectors to re-score top-k results. Default is true.
169+
*/
170+
optional bool rescore = 2;
171+
}
172+
161173
message SearchParams {
162174
/*
163175
Params relevant to HNSW index. Size of the beam in a beam-search.
@@ -169,6 +181,11 @@ message SearchParams {
169181
Search without approximation. If set to true, search may run long but with exact results.
170182
*/
171183
optional bool exact = 2;
184+
185+
/*
186+
If set to true, search will ignore quantized vector data
187+
*/
188+
optional QuantizationSearchParams quantization = 3;
172189
}
173190

174191
message SearchPoints {
@@ -359,9 +376,19 @@ message Match {
359376
int64 integer = 2; // Match integer
360377
bool boolean = 3; // Match boolean
361378
string text = 4; // Match text
379+
RepeatedStrings keywords = 5; // Match multiple keywords
380+
RepeatedIntegers integers = 6; // Match multiple integers
362381
}
363382
}
364383

384+
message RepeatedStrings {
385+
repeated string strings = 1;
386+
}
387+
388+
message RepeatedIntegers {
389+
repeated int64 integers = 1;
390+
}
391+
365392
message Range {
366393
optional double lt = 1;
367394
optional double gt = 2;

src/qdrant.rs

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,34 @@ pub struct OptimizersConfigDiff {
171171
}
172172
#[allow(clippy::derive_partial_eq_without_eq)]
173173
#[derive(Clone, PartialEq, ::prost::Message)]
174+
pub struct ScalarQuantization {
175+
/// Type of quantization
176+
#[prost(enumeration = "QuantizationType", tag = "1")]
177+
pub r#type: i32,
178+
/// Number of bits to use for quantization
179+
#[prost(float, optional, tag = "2")]
180+
pub quantile: ::core::option::Option<f32>,
181+
/// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
182+
#[prost(bool, optional, tag = "3")]
183+
pub always_ram: ::core::option::Option<bool>,
184+
}
185+
#[allow(clippy::derive_partial_eq_without_eq)]
186+
#[derive(Clone, PartialEq, ::prost::Message)]
187+
pub struct QuantizationConfig {
188+
#[prost(oneof = "quantization_config::Quantization", tags = "1")]
189+
pub quantization: ::core::option::Option<quantization_config::Quantization>,
190+
}
191+
/// Nested message and enum types in `QuantizationConfig`.
192+
pub mod quantization_config {
193+
#[allow(clippy::derive_partial_eq_without_eq)]
194+
#[derive(Clone, PartialEq, ::prost::Oneof)]
195+
pub enum Quantization {
196+
#[prost(message, tag = "1")]
197+
Scalar(super::ScalarQuantization),
198+
}
199+
}
200+
#[allow(clippy::derive_partial_eq_without_eq)]
201+
#[derive(Clone, PartialEq, ::prost::Message)]
174202
pub struct CreateCollection {
175203
/// Name of the collection
176204
#[prost(string, tag = "1")]
@@ -205,6 +233,8 @@ pub struct CreateCollection {
205233
/// Specify name of the other collection to copy data from
206234
#[prost(string, optional, tag = "13")]
207235
pub init_from_collection: ::core::option::Option<::prost::alloc::string::String>,
236+
#[prost(message, optional, tag = "14")]
237+
pub quantization_config: ::core::option::Option<QuantizationConfig>,
208238
}
209239
#[allow(clippy::derive_partial_eq_without_eq)]
210240
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -286,6 +316,9 @@ pub struct CollectionConfig {
286316
/// Configuration of the Write-Ahead-Log
287317
#[prost(message, optional, tag = "4")]
288318
pub wal_config: ::core::option::Option<WalConfigDiff>,
319+
/// Configuration of the vector quantization
320+
#[prost(message, optional, tag = "5")]
321+
pub quantization_config: ::core::option::Option<QuantizationConfig>,
289322
}
290323
#[allow(clippy::derive_partial_eq_without_eq)]
291324
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -555,6 +588,32 @@ impl PayloadSchemaType {
555588
}
556589
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
557590
#[repr(i32)]
591+
pub enum QuantizationType {
592+
UnknownQuantization = 0,
593+
Int8 = 1,
594+
}
595+
impl QuantizationType {
596+
/// String value of the enum field names used in the ProtoBuf definition.
597+
///
598+
/// The values are not transformed in any way and thus are considered stable
599+
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
600+
pub fn as_str_name(&self) -> &'static str {
601+
match self {
602+
QuantizationType::UnknownQuantization => "UnknownQuantization",
603+
QuantizationType::Int8 => "Int8",
604+
}
605+
}
606+
/// Creates an enum from field names used in the ProtoBuf definition.
607+
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
608+
match value {
609+
"UnknownQuantization" => Some(Self::UnknownQuantization),
610+
"Int8" => Some(Self::Int8),
611+
_ => None,
612+
}
613+
}
614+
}
615+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
616+
#[repr(i32)]
558617
pub enum TokenizerType {
559618
Unknown = 0,
560619
Prefix = 1,
@@ -1657,6 +1716,18 @@ pub mod with_vectors_selector {
16571716
}
16581717
#[allow(clippy::derive_partial_eq_without_eq)]
16591718
#[derive(Clone, PartialEq, ::prost::Message)]
1719+
pub struct QuantizationSearchParams {
1720+
///
1721+
/// If set to true, search will ignore quantized vector data
1722+
#[prost(bool, optional, tag = "1")]
1723+
pub ignore: ::core::option::Option<bool>,
1724+
///
1725+
/// If true, use original vectors to re-score top-k results. Default is true.
1726+
#[prost(bool, optional, tag = "2")]
1727+
pub rescore: ::core::option::Option<bool>,
1728+
}
1729+
#[allow(clippy::derive_partial_eq_without_eq)]
1730+
#[derive(Clone, PartialEq, ::prost::Message)]
16601731
pub struct SearchParams {
16611732
///
16621733
/// Params relevant to HNSW index. Size of the beam in a beam-search.
@@ -1667,6 +1738,10 @@ pub struct SearchParams {
16671738
/// Search without approximation. If set to true, search may run long but with exact results.
16681739
#[prost(bool, optional, tag = "2")]
16691740
pub exact: ::core::option::Option<bool>,
1741+
///
1742+
/// If set to true, search will ignore quantized vector data
1743+
#[prost(message, optional, tag = "3")]
1744+
pub quantization: ::core::option::Option<QuantizationSearchParams>,
16701745
}
16711746
#[allow(clippy::derive_partial_eq_without_eq)]
16721747
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -2014,7 +2089,7 @@ pub struct FieldCondition {
20142089
#[allow(clippy::derive_partial_eq_without_eq)]
20152090
#[derive(Clone, PartialEq, ::prost::Message)]
20162091
pub struct Match {
2017-
#[prost(oneof = "r#match::MatchValue", tags = "1, 2, 3, 4")]
2092+
#[prost(oneof = "r#match::MatchValue", tags = "1, 2, 3, 4, 5, 6")]
20182093
pub match_value: ::core::option::Option<r#match::MatchValue>,
20192094
}
20202095
/// Nested message and enum types in `Match`.
@@ -2034,10 +2109,28 @@ pub mod r#match {
20342109
/// Match text
20352110
#[prost(string, tag = "4")]
20362111
Text(::prost::alloc::string::String),
2112+
/// Match multiple keywords
2113+
#[prost(message, tag = "5")]
2114+
Keywords(super::RepeatedStrings),
2115+
/// Match multiple integers
2116+
#[prost(message, tag = "6")]
2117+
Integers(super::RepeatedIntegers),
20372118
}
20382119
}
20392120
#[allow(clippy::derive_partial_eq_without_eq)]
20402121
#[derive(Clone, PartialEq, ::prost::Message)]
2122+
pub struct RepeatedStrings {
2123+
#[prost(string, repeated, tag = "1")]
2124+
pub strings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2125+
}
2126+
#[allow(clippy::derive_partial_eq_without_eq)]
2127+
#[derive(Clone, PartialEq, ::prost::Message)]
2128+
pub struct RepeatedIntegers {
2129+
#[prost(int64, repeated, tag = "1")]
2130+
pub integers: ::prost::alloc::vec::Vec<i64>,
2131+
}
2132+
#[allow(clippy::derive_partial_eq_without_eq)]
2133+
#[derive(Clone, PartialEq, ::prost::Message)]
20412134
pub struct Range {
20422135
#[prost(double, optional, tag = "1")]
20432136
pub lt: ::core::option::Option<f64>,

tests/integration-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function stop_docker()
1111
# Ensure current path is project root
1212
cd "$(dirname "$0")/../"
1313

14-
QDRANT_VERSION='v1.0.3'
14+
QDRANT_VERSION='v1.1.0'
1515

1616
QDRANT_HOST='localhost:6333'
1717

0 commit comments

Comments
 (0)