@@ -186,7 +186,7 @@ describe('Testing of the collection.config namespace', () => {
186
186
expect ( config . vectorizers . title . vectorizer . name ) . toEqual ( 'text2vec-contextionary' ) ;
187
187
} ) ;
188
188
189
- it ( 'should be able to get the config of a collection with HNSW+PQ ' , async ( ) => {
189
+ it ( 'should be able to get the config of a collection with hnsw-pq ' , async ( ) => {
190
190
const collectionName = 'TestCollectionConfigGetHNSWPlusPQ' ;
191
191
const collection = await client . collections . create ( {
192
192
name : collectionName ,
@@ -204,12 +204,13 @@ describe('Testing of the collection.config namespace', () => {
204
204
expect ( config . reranker ) . toBeUndefined ( ) ;
205
205
expect ( vectorIndexConfig ) . toBeDefined ( ) ;
206
206
expect ( vectorIndexConfig . quantizer ) . toBeDefined ( ) ;
207
+ expect ( vectorIndexConfig . quantizer ?. type ) . toEqual ( 'pq' ) ;
207
208
expect ( config . vectorizers . default . indexType ) . toEqual ( 'hnsw' ) ;
208
209
expect ( config . vectorizers . default . properties ) . toBeUndefined ( ) ;
209
210
expect ( config . vectorizers . default . vectorizer . name ) . toEqual ( 'none' ) ;
210
211
} ) ;
211
212
212
- it ( 'should be able to get the config of a collection with HNSW+BQ ' , async ( ) => {
213
+ it ( 'should be able to get the config of a collection with hnsw-bq ' , async ( ) => {
213
214
const collectionName = 'TestCollectionConfigGetHNSWPlusBQ' ;
214
215
const query = ( ) =>
215
216
client . collections . create ( {
@@ -232,12 +233,37 @@ describe('Testing of the collection.config namespace', () => {
232
233
expect ( config . reranker ) . toBeUndefined ( ) ;
233
234
expect ( vectorIndexConfig ) . toBeDefined ( ) ;
234
235
expect ( vectorIndexConfig . quantizer ) . toBeDefined ( ) ;
236
+ expect ( vectorIndexConfig . quantizer ?. type ) . toEqual ( 'bq' ) ;
235
237
expect ( config . vectorizers . default . indexType ) . toEqual ( 'hnsw' ) ;
236
238
expect ( config . vectorizers . default . properties ) . toBeUndefined ( ) ;
237
239
expect ( config . vectorizers . default . vectorizer . name ) . toEqual ( 'none' ) ;
238
240
} ) ;
239
241
240
- it ( 'should be able to get the config of a collection with flat+BQ' , async ( ) => {
242
+ requireAtLeast ( 1 , 26 , 0 ) . it ( 'should be able to get the config of a collection with hnsw-sq' , async ( ) => {
243
+ const collectionName = 'TestCollectionConfigGetHNSWPlusSQ' ;
244
+ const collection = await client . collections . create ( {
245
+ name : collectionName ,
246
+ vectorizers : weaviate . configure . vectorizer . none ( {
247
+ vectorIndexConfig : weaviate . configure . vectorIndex . hnsw ( {
248
+ quantizer : weaviate . configure . vectorIndex . quantizer . sq ( ) ,
249
+ } ) ,
250
+ } ) ,
251
+ } ) ;
252
+ const config = await collection . config . get ( ) ;
253
+
254
+ const vectorIndexConfig = config . vectorizers . default . indexConfig as VectorIndexConfigHNSW ;
255
+ expect ( config . name ) . toEqual ( collectionName ) ;
256
+ expect ( config . generative ) . toBeUndefined ( ) ;
257
+ expect ( config . reranker ) . toBeUndefined ( ) ;
258
+ expect ( vectorIndexConfig ) . toBeDefined ( ) ;
259
+ expect ( vectorIndexConfig . quantizer ) . toBeDefined ( ) ;
260
+ expect ( vectorIndexConfig . quantizer ?. type ) . toEqual ( 'sq' ) ;
261
+ expect ( config . vectorizers . default . indexType ) . toEqual ( 'hnsw' ) ;
262
+ expect ( config . vectorizers . default . properties ) . toBeUndefined ( ) ;
263
+ expect ( config . vectorizers . default . vectorizer . name ) . toEqual ( 'none' ) ;
264
+ } ) ;
265
+
266
+ it ( 'should be able to get the config of a collection with flat-bq' , async ( ) => {
241
267
const collectionName = 'TestCollectionConfigGetFlatPlusBQ' ;
242
268
const collection = await client . collections . create ( {
243
269
name : collectionName ,
@@ -255,12 +281,13 @@ describe('Testing of the collection.config namespace', () => {
255
281
expect ( config . reranker ) . toBeUndefined ( ) ;
256
282
expect ( vectorIndexConfig ) . toBeDefined ( ) ;
257
283
expect ( vectorIndexConfig . quantizer ) . toBeDefined ( ) ;
284
+ expect ( vectorIndexConfig . quantizer ?. type ) . toEqual ( 'bq' ) ;
258
285
expect ( config . vectorizers . default . indexType ) . toEqual ( 'flat' ) ;
259
286
expect ( config . vectorizers . default . properties ) . toBeUndefined ( ) ;
260
287
expect ( config . vectorizers . default . vectorizer . name ) . toEqual ( 'none' ) ;
261
288
} ) ;
262
289
263
- it ( 'should be able to get the config of a single-vector collection with dynamic+BQ ' , async ( ) => {
290
+ it ( 'should be able to get the config of a single-vector collection with dynamic hnsw-pq & flat-bq ' , async ( ) => {
264
291
const asyncIndexing = await weaviate . connectToLocal ( { port : 8078 , grpcPort : 50049 } ) ; // need async indexing for dynamic vectorizer
265
292
const collectionName = 'TestSVCollectionConfigGetDynamicPlusBQ' ;
266
293
await asyncIndexing . collections . delete ( collectionName ) ;
@@ -292,14 +319,16 @@ describe('Testing of the collection.config namespace', () => {
292
319
expect ( ( vectorIndexConfig as any ) . quantizer ) . toBeUndefined ( ) ;
293
320
expect ( vectorIndexConfig . hnsw ) . toBeDefined ( ) ;
294
321
expect ( vectorIndexConfig . hnsw . quantizer ) . toBeDefined ( ) ;
322
+ expect ( vectorIndexConfig . hnsw . quantizer ?. type ) . toEqual ( 'pq' ) ;
295
323
expect ( vectorIndexConfig . flat ) . toBeDefined ( ) ;
296
324
expect ( vectorIndexConfig . flat . quantizer ) . toBeDefined ( ) ;
325
+ expect ( vectorIndexConfig . flat . quantizer ?. type ) . toEqual ( 'bq' ) ;
297
326
expect ( config . vectorizers . default . indexType ) . toEqual ( 'dynamic' ) ;
298
327
expect ( config . vectorizers . default . properties ) . toBeUndefined ( ) ;
299
328
expect ( config . vectorizers . default . vectorizer . name ) . toEqual ( 'none' ) ;
300
329
} ) ;
301
330
302
- it ( 'should be able to get the config of a multi-vector collection with dynamic+BQ ' , async ( ) => {
331
+ it ( 'should be able to get the config of a multi-vector collection with dynamic hnsw-pq & flat-bq ' , async ( ) => {
303
332
const asyncIndexing = await weaviate . connectToLocal ( { port : 8078 , grpcPort : 50049 } ) ; // need async indexing for dynamic vectorizer
304
333
const collectionName = 'TestMVCollectionConfigGetDynamicPlusBQ' ;
305
334
await asyncIndexing . collections . delete ( collectionName ) ;
@@ -331,8 +360,10 @@ describe('Testing of the collection.config namespace', () => {
331
360
expect ( ( vectorIndexConfig as any ) . quantizer ) . toBeUndefined ( ) ;
332
361
expect ( vectorIndexConfig . hnsw ) . toBeDefined ( ) ;
333
362
expect ( vectorIndexConfig . hnsw . quantizer ) . toBeDefined ( ) ;
363
+ expect ( vectorIndexConfig . hnsw . quantizer ?. type ) . toEqual ( 'pq' ) ;
334
364
expect ( vectorIndexConfig . flat ) . toBeDefined ( ) ;
335
365
expect ( vectorIndexConfig . flat . quantizer ) . toBeDefined ( ) ;
366
+ expect ( vectorIndexConfig . flat . quantizer ?. type ) . toEqual ( 'bq' ) ;
336
367
expect ( config . vectorizers . default . indexType ) . toEqual ( 'dynamic' ) ;
337
368
expect ( config . vectorizers . default . properties ) . toBeUndefined ( ) ;
338
369
expect ( config . vectorizers . default . vectorizer . name ) . toEqual ( 'none' ) ;
@@ -387,11 +418,7 @@ describe('Testing of the collection.config namespace', () => {
387
418
] ) ;
388
419
} ) ;
389
420
390
- requireAtLeast (
391
- 1 ,
392
- 31 ,
393
- 0
394
- ) ( 'Mutable named vectors' , ( ) => {
421
+ requireAtLeast ( 1 , 31 , 0 ) . describe ( 'Mutable named vectors' , ( ) => {
395
422
it ( 'should be able to add named vectors to a collection' , async ( ) => {
396
423
const collectionName = 'TestCollectionConfigAddVector' as const ;
397
424
const collection = await client . collections . create ( {
0 commit comments