@@ -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 ) ]
174202pub 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 ) ]
558617pub 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 ) ]
16601731pub 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 ) ]
20162091pub 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 ) ]
20412134pub struct Range {
20422135 #[ prost( double, optional, tag = "1" ) ]
20432136 pub lt : :: core:: option:: Option < f64 > ,
0 commit comments