diff --git a/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndex.java b/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndex.java index e2152bf80..cc161da70 100644 --- a/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndex.java +++ b/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndex.java @@ -22,4 +22,13 @@ package org.redisson.api.search.index; * */ public interface FlatVectorIndex extends VectorTypeParam { + + /** + * Defines the attribute associated to the field name + * + * @param as the associated attribute + * @return options object + */ + FlatVectorIndex as(String as); + } diff --git a/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndexParams.java b/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndexParams.java index d6f678307..12f73dc26 100644 --- a/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndexParams.java +++ b/redisson/src/main/java/org/redisson/api/search/index/FlatVectorIndexParams.java @@ -32,11 +32,18 @@ public final class FlatVectorIndexParams implements FlatVectorIndex, private Integer initialCapacity; private Integer blockSize; private int count; + private String as; FlatVectorIndexParams(String name) { this.fieldName = name; } + @Override + public FlatVectorIndexParams as(String as) { + this.as = as; + return this; + } + @Override public VectorDimParam type(Type type) { count++; @@ -99,4 +106,8 @@ public final class FlatVectorIndexParams implements FlatVectorIndex, public int getCount() { return count; } + + public String getAs() { + return as; + } } diff --git a/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndex.java b/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndex.java index c5252768f..bc96109db 100644 --- a/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndex.java +++ b/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndex.java @@ -22,4 +22,13 @@ package org.redisson.api.search.index; * */ public interface HNSWVectorIndex extends VectorTypeParam { + + /** + * Defines the attribute associated to the field name + * + * @param as the associated attribute + * @return options object + */ + HNSWVectorIndex as(String as); + } diff --git a/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndexParams.java b/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndexParams.java index 1672faa88..d731fac3a 100644 --- a/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndexParams.java +++ b/redisson/src/main/java/org/redisson/api/search/index/HNSWVectorIndexParams.java @@ -34,13 +34,19 @@ public final class HNSWVectorIndexParams implements HNSWVectorIndex, private Integer efConstruction; private Integer efRuntime; private Double epsilon; - private int count; + private String as; HNSWVectorIndexParams(String name) { this.fieldName = name; } + @Override + public HNSWVectorIndexParams as(String as) { + this.as = as; + return this; + } + @Override public VectorDimParam type(Type type) { count++; @@ -136,4 +142,8 @@ public final class HNSWVectorIndexParams implements HNSWVectorIndex, public int getCount() { return count; } + + public String getAs() { + return as; + } }