Skip to content

Commit

Permalink
Support FLOAT16 and BFLOAT16 VecSim storage types (#3849)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Jun 13, 2024
1 parent 33d4771 commit 7c898b8
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,28 @@ public void testFlatVectorSimilarity() {
assertEquals("0", doc1.get("__v_score"));
}

@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")));
Expand Down

0 comments on commit 7c898b8

Please sign in to comment.