Skip to content

Commit 3613df6

Browse files
authored
Add tests case with FLOAT16 and BFLOAT16 vectors (#3054)
* Add tests case with FLOAT16 and BFLOAT16 vectors * Remove from enterprise
1 parent 46d2452 commit 3613df6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

search_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,16 @@ var _ = Describe("RediSearch commands", Label("search"), func() {
11481148
Expect(res2.Total).To(BeEquivalentTo(int64(2)))
11491149
})
11501150

1151+
It("should create search index with FLOAT16 and BFLOAT16 vectors", Label("search", "ftcreate", "NonRedisEnterprise"), func() {
1152+
val, err := client.FTCreate(ctx, "index", &redis.FTCreateOptions{},
1153+
&redis.FieldSchema{FieldName: "float16", FieldType: redis.SearchFieldTypeVector, VectorArgs: &redis.FTVectorArgs{FlatOptions: &redis.FTFlatOptions{Type: "FLOAT16", Dim: 768, DistanceMetric: "COSINE"}}},
1154+
&redis.FieldSchema{FieldName: "bfloat16", FieldType: redis.SearchFieldTypeVector, VectorArgs: &redis.FTVectorArgs{FlatOptions: &redis.FTFlatOptions{Type: "BFLOAT16", Dim: 768, DistanceMetric: "COSINE"}}},
1155+
).Result()
1156+
Expect(err).NotTo(HaveOccurred())
1157+
Expect(val).To(BeEquivalentTo("OK"))
1158+
WaitForIndexing(client, "index")
1159+
})
1160+
11511161
It("should test geoshapes query intersects and disjoint", Label("NonRedisEnterprise"), func() {
11521162
_, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, &redis.FieldSchema{
11531163
FieldName: "g",

0 commit comments

Comments
 (0)