|
2 | 2 | import { requireAtLeast } from '../../../test/version.js'; |
3 | 3 | import { WeaviateUnsupportedFeatureError } from '../../errors.js'; |
4 | 4 | import weaviate, { WeaviateClient, weaviateV2 } from '../../index.js'; |
| 5 | +import { WeaviateClass } from '../../openapi/types.js'; |
5 | 6 | import { |
6 | 7 | GenerativeCohereConfig, |
7 | 8 | ModuleConfig, |
@@ -833,4 +834,47 @@ describe('Testing of the collection.config namespace', () => { |
833 | 834 | expect(indexConfig.multiVector?.encoding).toBeUndefined(); |
834 | 835 | } |
835 | 836 | ); |
| 837 | + |
| 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'; |
| 841 | + const collection = await client.collections.create({ |
| 842 | + name: collectionName, |
| 843 | + vectorizers: weaviate.configure.vectors.selfProvided({ |
| 844 | + quantizer: weaviate.configure.vectorIndex.quantizer.none(), |
| 845 | + }), |
| 846 | + }); |
| 847 | + await collection.config |
| 848 | + .get() |
| 849 | + .then((config) => |
| 850 | + expect((config.vectorizers.default.indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined() |
| 851 | + ); |
| 852 | + await fetch(`http://localhost:8080/v1/schema/${collectionName}`) |
| 853 | + .then((res) => res.json() as WeaviateClass) |
| 854 | + .then((schema) => |
| 855 | + expect(schema.vectorConfig?.default.vectorIndexConfig?.skipDefaultQuantization).toBe(true) |
| 856 | + ); |
| 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 | + }); |
836 | 880 | }); |
0 commit comments