You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-14 09:42:12 +03:00
feat(integer 8 vector support): Changed ft create vector types to union, added support for int8/uint8 (#2911)
* [CAE-827] Changed ft create vector types to union, added support for int8/uint8 * [CAE-827] Moved test cases
This commit is contained in:
@@ -473,4 +473,87 @@ describe('FT.CREATE', () => {
|
||||
'OK'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
|
||||
testUtils.testWithClientIfVersionWithinRange([[7], 'LATEST'], 'client.ft.create vector types big floats', async client => {
|
||||
assert.equal(
|
||||
await client.ft.create("index_float32", {
|
||||
field: {
|
||||
ALGORITHM: "FLAT",
|
||||
TYPE: "FLOAT32",
|
||||
DIM: 1,
|
||||
DISTANCE_METRIC: 'COSINE',
|
||||
type: 'VECTOR'
|
||||
},
|
||||
}),
|
||||
"OK"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
await client.ft.create("index_float64", {
|
||||
field: {
|
||||
ALGORITHM: "FLAT",
|
||||
TYPE: "FLOAT64",
|
||||
DIM: 1,
|
||||
DISTANCE_METRIC: 'COSINE',
|
||||
type: 'VECTOR'
|
||||
},
|
||||
}),
|
||||
"OK"
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
|
||||
|
||||
testUtils.testWithClientIfVersionWithinRange([[8], 'LATEST'], 'client.ft.create vector types small floats and ints', async client => {
|
||||
assert.equal(
|
||||
await client.ft.create("index_float16", {
|
||||
field: {
|
||||
ALGORITHM: "FLAT",
|
||||
TYPE: "FLOAT16",
|
||||
DIM: 1,
|
||||
DISTANCE_METRIC: 'COSINE',
|
||||
type: 'VECTOR'
|
||||
},
|
||||
}),
|
||||
"OK"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
await client.ft.create("index_bloat16", {
|
||||
field: {
|
||||
ALGORITHM: "FLAT",
|
||||
TYPE: "BFLOAT16",
|
||||
DIM: 1,
|
||||
DISTANCE_METRIC: 'COSINE',
|
||||
type: 'VECTOR'
|
||||
},
|
||||
}),
|
||||
"OK"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
await client.ft.create("index_int8", {
|
||||
field: {
|
||||
ALGORITHM: "FLAT",
|
||||
TYPE: "INT8",
|
||||
DIM: 1,
|
||||
DISTANCE_METRIC: 'COSINE',
|
||||
type: 'VECTOR'
|
||||
},
|
||||
}),
|
||||
"OK"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
await client.ft.create("index_uint8", {
|
||||
field: {
|
||||
ALGORITHM: "FLAT",
|
||||
TYPE: "UINT8",
|
||||
DIM: 1,
|
||||
DISTANCE_METRIC: 'COSINE',
|
||||
type: 'VECTOR'
|
||||
},
|
||||
}),
|
||||
"OK"
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user