@@ -46,6 +46,8 @@ import {
4646 PQEncoderType ,
4747 PropertyConfig ,
4848 PropertyVectorizerConfig ,
49+ QuantizerConfig ,
50+ RQConfig ,
4951 ReferenceConfig ,
5052 ReplicationConfig ,
5153 Reranker ,
@@ -207,6 +209,16 @@ export const parseVectorIndex = (module: ModuleConfig<VectorIndexType, VectorInd
207209 } ,
208210 } ;
209211 }
212+ if ( QuantizerGuards . isRQCreate ( quantizer ) ) {
213+ const { type, ...quant } = quantizer ;
214+ return {
215+ ...conf ,
216+ rq : {
217+ ...quant ,
218+ enabled : true ,
219+ } ,
220+ } ;
221+ }
210222} ;
211223
212224export const parseVectorizerConfig = ( config ?: VectorizerConfig ) : any => {
@@ -493,11 +505,13 @@ class ConfigMapping {
493505 throw new WeaviateDeserializationError (
494506 'Vector index vector cache max objects was not returned by Weaviate'
495507 ) ;
496- let quantizer : PQConfig | BQConfig | SQConfig | undefined ;
508+ let quantizer : QuantizerConfig | undefined ;
497509 if ( exists < Record < string , any > > ( v . pq ) && v . pq . enabled === true ) {
498510 quantizer = ConfigMapping . pq ( v . pq ) ;
499511 } else if ( exists < Record < string , any > > ( v . bq ) && v . bq . enabled === true ) {
500512 quantizer = ConfigMapping . bq ( v . bq ) ;
513+ } else if ( exists < Record < string , any > > ( v . rq ) && v . rq . enabled === true ) {
514+ quantizer = ConfigMapping . rq ( v . rq ) ;
501515 } else if ( exists < Record < string , any > > ( v . sq ) && v . sq . enabled === true ) {
502516 quantizer = ConfigMapping . sq ( v . sq ) ;
503517 } else {
@@ -564,6 +578,19 @@ class ConfigMapping {
564578 type : 'bq' ,
565579 } ;
566580 }
581+ static rq ( v ?: Record < string , unknown > ) : RQConfig | undefined {
582+ if ( v === undefined ) throw new WeaviateDeserializationError ( 'RQ was not returned by Weaviate' ) ;
583+ if ( ! exists < boolean > ( v . enabled ) )
584+ throw new WeaviateDeserializationError ( 'RQ enabled was not returned by Weaviate' ) ;
585+ if ( v . enabled === false ) return undefined ;
586+ const bits = v . bits === undefined ? 6 : ( v . bits as number ) ;
587+ const rescoreLimit = v . rescoreLimit === undefined ? 20 : ( v . rescoreLimit as number ) ;
588+ return {
589+ bits,
590+ rescoreLimit,
591+ type : 'rq' ,
592+ } ;
593+ }
567594 static sq ( v ?: Record < string , unknown > ) : SQConfig | undefined {
568595 if ( v === undefined ) throw new WeaviateDeserializationError ( 'SQ was not returned by Weaviate' ) ;
569596 if ( ! exists < boolean > ( v . enabled ) )
0 commit comments