From 903cd76d0925afce74d043343a714694f00fd072 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 13 Jun 2024 18:24:55 +0600 Subject: [PATCH] Support FLOAT16 and BFLOAT16 VecSim storage types (#3849) --- .../modules/search/SearchWithParamsTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/java/redis/clients/jedis/modules/search/SearchWithParamsTest.java b/src/test/java/redis/clients/jedis/modules/search/SearchWithParamsTest.java index d04bff2640..f67817f724 100644 --- a/src/test/java/redis/clients/jedis/modules/search/SearchWithParamsTest.java +++ b/src/test/java/redis/clients/jedis/modules/search/SearchWithParamsTest.java @@ -1169,6 +1169,28 @@ public void vectorFieldParams() { // throws Field `NOINDEX` does not have a type } + @Test + public void float16StorageType() { + assertOK(client.ftCreate(index, + VectorField.builder().fieldName("v") + .algorithm(VectorField.VectorAlgorithm.HNSW) + .addAttribute("TYPE", "FLOAT16") + .addAttribute("DIM", 4) + .addAttribute("DISTANCE_METRIC", "L2") + .build())); + } + + @Test + public void bfloat16StorageType() { + assertOK(client.ftCreate(index, + VectorField.builder().fieldName("v") + .algorithm(VectorField.VectorAlgorithm.HNSW) + .addAttribute("TYPE", "BFLOAT16") + .addAttribute("DIM", 4) + .addAttribute("DISTANCE_METRIC", "L2") + .build())); + } + @Test public void searchProfile() { assertOK(client.ftCreate(index, TextField.of("t1"), TextField.of("t2")));