Skip to content

Commit 79affde

Browse files
committed
Cherry pick changes from #340
1 parent fe199f2 commit 79affde

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

src/collections/config/integration.test.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,9 @@ describe('Testing of the collection.config namespace', () => {
835835
}
836836
);
837837

838-
requireAtLeast(1, 32, 4).it(
839-
'should be able to create a collection with an uncompressed quantizer',
840-
async () => {
841-
const collectionName = 'TestCollectionConfigCreateWithUncompressedQuantizer';
838+
requireAtLeast(1, 32, 4).describe('uncompressed quantizer', () => {
839+
it('should be able to create a collection with an uncompressed quantizer', async () => {
840+
const collectionName = 'TestCollectionUncompressedVector';
842841
const collection = await client.collections.create({
843842
name: collectionName,
844843
vectorizers: weaviate.configure.vectors.selfProvided({
@@ -855,6 +854,27 @@ describe('Testing of the collection.config namespace', () => {
855854
.then((schema) =>
856855
expect(schema.vectorConfig?.default.vectorIndexConfig?.skipDefaultQuantization).toBe(true)
857856
);
858-
}
859-
);
857+
});
858+
859+
it('should be able to create a collection with uncompressed named vector', async () => {
860+
const collectionName = 'TestCollectionUncompressedVectorNamed';
861+
const collection = await client.collections.create({
862+
name: collectionName,
863+
vectorizers: weaviate.configure.vectors.selfProvided({
864+
name: 'custom',
865+
quantizer: weaviate.configure.vectorIndex.quantizer.none(),
866+
}),
867+
});
868+
await collection.config
869+
.get()
870+
.then((config) =>
871+
expect((config.vectorizers.custom.indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined()
872+
);
873+
await fetch(`http://localhost:8080/v1/schema/${collectionName}`)
874+
.then((res) => res.json() as WeaviateClass)
875+
.then((schema) =>
876+
expect(schema.vectorConfig?.custom.vectorIndexConfig?.skipDefaultQuantization).toBe(true)
877+
);
878+
});
879+
});
860880
});

src/collections/configure/vectorIndex.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
ModuleConfig,
33
PQEncoderDistribution,
44
PQEncoderType,
5+
UncompressedConfig,
56
VectorIndexFilterStrategy,
67
} from '../config/types/index.js';
78
import {
@@ -150,14 +151,14 @@ const configure = {
150151
*/
151152
quantizer: {
152153
/**
153-
* Create an object of type `NoneConfigCreate` to be used when defining the quantizer configuration of a vector index.
154+
* Create an object of type `UncompressedConfig` to be used when defining the quantizer configuration of a vector index.
154155
*
155156
* This is useful for disabling the default quantization present in Weaviate>=1.33.0.
157+
*
158+
* @returns {UncompressedConfig} The object of type `UncompressedConfig`.
156159
*/
157-
none: () => {
158-
return {
159-
type: 'none',
160-
};
160+
none: (): UncompressedConfig => {
161+
return { type: 'none' };
161162
},
162163
/**
163164
* Create an object of type `BQConfigCreate` to be used when defining the quantizer configuration of a vector index.

0 commit comments

Comments
 (0)