Skip to content

Commit c293911

Browse files
committed
Add tests case with FLOAT16 and BFLOAT16 vectors
1 parent 67824eb commit c293911

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

search_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,16 @@ var _ = Describe("RediSearch commands", Label("search"), func() {
10431043
Expect(err).NotTo(HaveOccurred())
10441044
Expect(res2.Total).To(BeEquivalentTo(int64(2)))
10451045
})
1046+
1047+
It("should create search index with FLOAT16 and BFLOAT16 vectors", Label("search", "ftcreate"), func() {
1048+
val, err := client.FTCreate(ctx, "index", &redis.FTCreateOptions{},
1049+
&redis.FieldSchema{FieldName: "float16", FieldType: redis.SearchFieldTypeVector, VectorArgs: &redis.FTVectorArgs{FlatOptions: &redis.FTFlatOptions{Type: "FLOAT16", Dim: 768, DistanceMetric: "COSINE"}}},
1050+
&redis.FieldSchema{FieldName: "bfloat16", FieldType: redis.SearchFieldTypeVector, VectorArgs: &redis.FTVectorArgs{FlatOptions: &redis.FTFlatOptions{Type: "BFLOAT16", Dim: 768, DistanceMetric: "COSINE"}}},
1051+
).Result()
1052+
Expect(err).NotTo(HaveOccurred())
1053+
Expect(val).To(BeEquivalentTo("OK"))
1054+
WaitForIndexing(client, "index")
1055+
})
10461056
})
10471057

10481058
// It("should FTProfile Search and Aggregate", Label("search", "ftprofile"), func() {

0 commit comments

Comments
 (0)