Fixed - RSearch vector field doesn't support alias. #5286

pull/5300/head
Nikita Koksharov 1 year ago
parent eafaf9223c
commit 7b1c0f03bc

@ -22,4 +22,13 @@ package org.redisson.api.search.index;
* *
*/ */
public interface FlatVectorIndex extends VectorTypeParam<FlatVectorOptionalArgs> { public interface FlatVectorIndex extends VectorTypeParam<FlatVectorOptionalArgs> {
/**
* Defines the attribute associated to the field name
*
* @param as the associated attribute
* @return options object
*/
FlatVectorIndex as(String as);
} }

@ -32,11 +32,18 @@ public final class FlatVectorIndexParams implements FlatVectorIndex,
private Integer initialCapacity; private Integer initialCapacity;
private Integer blockSize; private Integer blockSize;
private int count; private int count;
private String as;
FlatVectorIndexParams(String name) { FlatVectorIndexParams(String name) {
this.fieldName = name; this.fieldName = name;
} }
@Override
public FlatVectorIndexParams as(String as) {
this.as = as;
return this;
}
@Override @Override
public VectorDimParam<FlatVectorOptionalArgs> type(Type type) { public VectorDimParam<FlatVectorOptionalArgs> type(Type type) {
count++; count++;
@ -99,4 +106,8 @@ public final class FlatVectorIndexParams implements FlatVectorIndex,
public int getCount() { public int getCount() {
return count; return count;
} }
public String getAs() {
return as;
}
} }

@ -22,4 +22,13 @@ package org.redisson.api.search.index;
* *
*/ */
public interface HNSWVectorIndex extends VectorTypeParam<HNSWVectorOptionalArgs> { public interface HNSWVectorIndex extends VectorTypeParam<HNSWVectorOptionalArgs> {
/**
* Defines the attribute associated to the field name
*
* @param as the associated attribute
* @return options object
*/
HNSWVectorIndex as(String as);
} }

@ -34,13 +34,19 @@ public final class HNSWVectorIndexParams implements HNSWVectorIndex,
private Integer efConstruction; private Integer efConstruction;
private Integer efRuntime; private Integer efRuntime;
private Double epsilon; private Double epsilon;
private int count; private int count;
private String as;
HNSWVectorIndexParams(String name) { HNSWVectorIndexParams(String name) {
this.fieldName = name; this.fieldName = name;
} }
@Override
public HNSWVectorIndexParams as(String as) {
this.as = as;
return this;
}
@Override @Override
public VectorDimParam<HNSWVectorOptionalArgs> type(Type type) { public VectorDimParam<HNSWVectorOptionalArgs> type(Type type) {
count++; count++;
@ -136,4 +142,8 @@ public final class HNSWVectorIndexParams implements HNSWVectorIndex,
public int getCount() { public int getCount() {
return count; return count;
} }
public String getAs() {
return as;
}
} }

Loading…
Cancel
Save