Skip to content
Merged
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
170 changes: 147 additions & 23 deletions proto/collections.proto

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ message DenseVectorCreationConfig {
Distance distance = 2;
// Configuration for multi-vector search (e.g., ColBERT)
optional MultiVectorConfig multivector_config = 3;
// Data type of the vectors (Float32, Float16, Uint8)
// Data type of the vectors (Float32, Float16, Uint8, Turbo4)
optional Datatype datatype = 4;
}

Expand Down Expand Up @@ -500,6 +500,14 @@ message AcornSearchParams {
optional double max_selectivity = 2;
}

// Population over which sparse vector IDF statistics are computed for scoring - the IDF corpus.
// Only applicable to sparse vectors with the IDF modifier enabled.
message IdfParams {
// Filter defining the corpus: IDF statistics are computed over the points matching this filter.
// If unset, statistics are collection-wide (global) - same as omitting `idf` entirely.
optional Filter corpus = 1;
}

message SearchParams {
// Params relevant to HNSW index. Size of the beam in a beam-search.
// Larger the value - more accurate the result, more time required for search.
Expand All @@ -517,6 +525,10 @@ message SearchParams {

// ACORN search params
optional AcornSearchParams acorn = 5;

// Which population sparse vector IDF statistics are computed over.
// If unset, statistics are collection-wide (global).
optional IdfParams idf = 6;
}

message SearchPoints {
Expand Down
10 changes: 10 additions & 0 deletions proto/qdrant_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ message Condition {
IsNullCondition is_null = 5;
NestedCondition nested = 6;
HasVectorCondition has_vector = 7;
SliceCondition slice = 8;
}
}

Expand All @@ -64,6 +65,13 @@ message HasVectorCondition {
string has_vector = 1;
}

message SliceCondition {
// Total number of disjoint deterministic slices the id space is split into, must be >= 1
uint32 total = 1;
// Which slice to select, must be less than `total`
uint32 index = 2;
}

message NestedCondition {
// Path to nested object
string key = 1;
Expand Down Expand Up @@ -115,6 +123,8 @@ message Match {
string phrase = 9;
// Match any word in the text
string text_any = 10;
// Match keywords starting with the given prefix
string prefix = 11;
}
}

Expand Down
21 changes: 21 additions & 0 deletions src/builders/binary_quantization_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ pub struct BinaryQuantizationBuilder {
pub(crate) always_ram: Option<Option<bool>>,
pub(crate) encoding: Option<Option<i32>>,
pub(crate) query_encoding: Option<Option<BinaryQuantizationQueryEncoding>>,
/// Memory placement of quantized vectors.
pub(crate) memory: Option<Option<i32>>,
}

impl BinaryQuantizationBuilder {
/// If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
///
/// Deprecated since 1.19.0, use [`memory`](Self::memory) instead.
pub fn always_ram(self, value: bool) -> Self {
let mut new = self;
new.always_ram = Some(Some(value));
Expand All @@ -33,11 +37,21 @@ impl BinaryQuantizationBuilder {
new
}

/// Memory placement of quantized vectors.
/// Overrides the deprecated `always_ram` flag if both are set.
pub fn memory(self, value: impl Into<i32>) -> Self {
let mut new = self;
new.memory = Some(Some(value.into()));
new
}

#[allow(deprecated)]
fn build_inner(self) -> Result<BinaryQuantization, BinaryQuantizationBuilderError> {
Ok(BinaryQuantization {
always_ram: self.always_ram.unwrap_or_default(),
encoding: self.encoding.unwrap_or_default(),
query_encoding: self.query_encoding.unwrap_or_default(),
memory: self.memory.unwrap_or_default(),
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand All @@ -46,6 +60,7 @@ impl BinaryQuantizationBuilder {
always_ram: Default::default(),
encoding: Default::default(),
query_encoding: Default::default(),
memory: Default::default(),
}
}
}
Expand Down Expand Up @@ -79,6 +94,12 @@ impl BinaryQuantizationBuilder {
}
}

impl Default for BinaryQuantizationBuilder {
fn default() -> Self {
Self::create_empty()
}
}

#[non_exhaustive]
#[derive(Debug)]
pub enum BinaryQuantizationBuilderError {
Expand Down
14 changes: 14 additions & 0 deletions src/builders/bool_index_params_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pub struct BoolIndexParamsBuilder {
pub(crate) on_disk: Option<Option<bool>>,
/// If true - enable HNSW index for this field.
pub(crate) enable_hnsw: Option<Option<bool>>,
/// Memory placement of the index.
pub(crate) memory: Option<Option<i32>>,
}

impl Default for BoolIndexParamsBuilder {
Expand All @@ -21,6 +23,8 @@ impl BoolIndexParamsBuilder {
}

/// If true - store index on disk.
///
/// Deprecated since 1.19.0, use [`memory`](Self::memory) instead.
pub fn on_disk(self, value: bool) -> Self {
let mut new = self;
new.on_disk = Option::Some(Option::Some(value));
Expand All @@ -32,18 +36,28 @@ impl BoolIndexParamsBuilder {
new.enable_hnsw = Option::Some(Option::Some(value));
new
}
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
pub fn memory<VALUE: core::convert::Into<i32>>(self, value: VALUE) -> Self {
let mut new = self;
new.memory = Option::Some(Option::Some(value.into()));
new
}

#[allow(deprecated)]
fn build_inner(self) -> Result<BoolIndexParams, std::convert::Infallible> {
Ok(BoolIndexParams {
on_disk: self.on_disk.unwrap_or_default(),
enable_hnsw: self.enable_hnsw.unwrap_or_default(),
memory: self.memory.unwrap_or_default(),
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
fn create_empty() -> Self {
Self {
on_disk: core::default::Default::default(),
enable_hnsw: core::default::Default::default(),
memory: core::default::Default::default(),
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/builders/collection_params_diff_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub struct CollectionParamsDiffBuilder {
pub(crate) read_fan_out_factor: Option<Option<u32>>,
/// Fan-out delay in milliseconds. If set, the fan-out request will be delayed by this amount.
pub(crate) read_fan_out_delay_ms: Option<Option<u64>>,
/// Update params of the payload storage
pub(crate) payload: Option<Option<PayloadStorageParams>>,
}
#[allow(clippy::all)]
#[allow(clippy::derive_partial_eq_without_eq)]
Expand All @@ -30,6 +32,8 @@ impl CollectionParamsDiffBuilder {
new
}
/// If true - point's payload will not be stored in memory
///
/// Deprecated since 1.19.0, use [`payload`](Self::payload) instead.
pub fn on_disk_payload(self, value: bool) -> Self {
let mut new = self;
new.on_disk_payload = Option::Some(Option::Some(value));
Expand All @@ -47,7 +51,15 @@ impl CollectionParamsDiffBuilder {
new.read_fan_out_delay_ms = Option::Some(Option::Some(value));
new
}
/// Update params of the payload storage.
/// Overrides the deprecated `on_disk_payload` flag if both are set.
pub fn payload<VALUE: core::convert::Into<PayloadStorageParams>>(self, value: VALUE) -> Self {
let mut new = self;
new.payload = Option::Some(Option::Some(value.into()));
new
}

#[allow(deprecated)]
fn build_inner(self) -> Result<CollectionParamsDiff, std::convert::Infallible> {
Ok(CollectionParamsDiff {
replication_factor: match self.replication_factor {
Expand All @@ -70,6 +82,10 @@ impl CollectionParamsDiffBuilder {
Some(value) => value,
None => core::default::Default::default(),
},
payload: match self.payload {
Some(value) => value,
None => core::default::Default::default(),
},
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand All @@ -80,6 +96,7 @@ impl CollectionParamsDiffBuilder {
on_disk_payload: core::default::Default::default(),
read_fan_out_factor: core::default::Default::default(),
read_fan_out_delay_ms: core::default::Default::default(),
payload: core::default::Default::default(),
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/builders/create_collection_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ pub struct CreateCollectionBuilder {
pub(crate) strict_mode_config: Option<Option<StrictModeConfig>>,
/// Arbitrary JSON metadata for the collection
pub(crate) metadata: Option<HashMap<String, Value>>,
/// Configuration of the payload storage
pub(crate) payload: Option<Option<PayloadStorageParams>>,
}

#[allow(clippy::all)]
Expand Down Expand Up @@ -76,6 +78,8 @@ impl CreateCollectionBuilder {
new
}
/// If true - point's payload will not be stored in memory
///
/// Deprecated since 1.19.0, use [`payload`](Self::payload) instead.
pub fn on_disk_payload(self, value: bool) -> Self {
let mut new = self;
new.on_disk_payload = Option::Some(Option::Some(value));
Expand Down Expand Up @@ -144,7 +148,15 @@ impl CreateCollectionBuilder {
new.metadata = Option::Some(value.into().0);
new
}
/// Configuration of the payload storage.
/// Overrides the deprecated `on_disk_payload` flag if both are set.
pub fn payload<VALUE: core::convert::Into<PayloadStorageParams>>(self, value: VALUE) -> Self {
let mut new = self;
new.payload = Option::Some(Option::Some(value.into()));
new
}

#[allow(deprecated)]
fn build_inner(self) -> Result<CreateCollection, std::convert::Infallible> {
Ok(CreateCollection {
collection_name: match self.collection_name {
Expand Down Expand Up @@ -204,6 +216,10 @@ impl CreateCollectionBuilder {
Some(value) => value,
None => core::default::Default::default(),
},
payload: match self.payload {
Some(value) => value,
None => core::default::Default::default(),
},
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand All @@ -224,6 +240,7 @@ impl CreateCollectionBuilder {
sparse_vectors_config: core::default::Default::default(),
strict_mode_config: core::default::Default::default(),
metadata: core::default::Default::default(),
payload: core::default::Default::default(),
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions src/builders/datetime_index_params_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ pub struct DatetimeIndexParamsBuilder {
pub(crate) is_principal: Option<Option<bool>>,
/// If true - enable HNSW index for this field.
pub(crate) enable_hnsw: Option<Option<bool>>,
/// Memory placement of the index.
pub(crate) memory: Option<Option<i32>>,
}

impl DatetimeIndexParamsBuilder {
/// If true - store index on disk.
///
/// Deprecated since 1.19.0, use [`memory`](Self::memory) instead.
pub fn on_disk(self, value: bool) -> Self {
let mut new = self;
new.on_disk = Option::Some(Option::Some(value));
Expand All @@ -30,12 +34,21 @@ impl DatetimeIndexParamsBuilder {
new.enable_hnsw = Option::Some(Option::Some(value));
new
}
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
pub fn memory<VALUE: core::convert::Into<i32>>(self, value: VALUE) -> Self {
let mut new = self;
new.memory = Option::Some(Option::Some(value.into()));
new
}

#[allow(deprecated)]
fn build_inner(self) -> Result<DatetimeIndexParams, std::convert::Infallible> {
Ok(DatetimeIndexParams {
on_disk: self.on_disk.unwrap_or_default(),
is_principal: self.is_principal.unwrap_or_default(),
enable_hnsw: self.enable_hnsw.unwrap_or_default(),
memory: self.memory.unwrap_or_default(),
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand All @@ -44,6 +57,7 @@ impl DatetimeIndexParamsBuilder {
on_disk: core::default::Default::default(),
is_principal: core::default::Default::default(),
enable_hnsw: core::default::Default::default(),
memory: core::default::Default::default(),
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions src/builders/float_index_params_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub struct FloatIndexParamsBuilder {
pub(crate) is_principal: Option<Option<bool>>,
/// If true - enable HNSW index for this field.
pub(crate) enable_hnsw: Option<Option<bool>>,
/// Memory placement of the index.
pub(crate) memory: Option<Option<i32>>,
}

impl Default for FloatIndexParamsBuilder {
Expand All @@ -23,6 +25,8 @@ impl FloatIndexParamsBuilder {
}

/// If true - store index on disk.
///
/// Deprecated since 1.19.0, use [`memory`](Self::memory) instead.
pub fn on_disk(self, value: bool) -> Self {
let mut new = self;
new.on_disk = Option::Some(Option::Some(value));
Expand All @@ -40,12 +44,21 @@ impl FloatIndexParamsBuilder {
new.enable_hnsw = Option::Some(Option::Some(value));
new
}
/// Memory placement of the index.
/// Overrides the deprecated `on_disk` flag if both are set.
pub fn memory<VALUE: core::convert::Into<i32>>(self, value: VALUE) -> Self {
let mut new = self;
new.memory = Option::Some(Option::Some(value.into()));
new
}

#[allow(deprecated)]
fn build_inner(self) -> Result<FloatIndexParams, std::convert::Infallible> {
Ok(FloatIndexParams {
on_disk: self.on_disk.unwrap_or_default(),
is_principal: self.is_principal.unwrap_or_default(),
enable_hnsw: self.enable_hnsw.unwrap_or_default(),
memory: self.memory.unwrap_or_default(),
})
}
/// Create an empty builder, with all fields set to `None` or `PhantomData`.
Expand All @@ -54,6 +67,7 @@ impl FloatIndexParamsBuilder {
on_disk: core::default::Default::default(),
is_principal: core::default::Default::default(),
enable_hnsw: core::default::Default::default(),
memory: core::default::Default::default(),
}
}
}
Expand Down
Loading
Loading