Package com.redis.vl.schema
Class VectorField.VectorFieldBuilder
java.lang.Object
com.redis.vl.schema.VectorField.VectorFieldBuilder
- Enclosing class:
VectorField
Fluent builder for VectorField
-
Method Summary
Modifier and TypeMethodDescriptionalgorithm
(VectorField.VectorAlgorithm algorithm) Set the vector indexing algorithmSet the field aliasblockSize
(int blockSize) Set the block size for FLAT algorithmbuild()
Build the VectorFielddataType
(VectorField.VectorDataType dataType) Set the data typedimensions
(int dimensions) Set the number of dimensionsdistanceMetric
(VectorField.DistanceMetric distanceMetric) Set the distance metricepsilon
(double epsilon) Set the epsilon parameter for HNSW algorithmhnswEfConstruction
(int efConstruction) Set the EF_CONSTRUCTION parameter for HNSW algorithmhnswEfRuntime
(int efRuntime) Set the EF_RUNTIME parameter for HNSW algorithmhnswM
(int m) Set the M parameter for HNSW algorithmindexed
(boolean indexed) Set whether the field is indexedinitialCapacity
(int initialCapacity) Set the initial capacity for FLAT algorithmSet the field namesortable
(boolean sortable) Set whether the field is sortablewithAlgorithm
(VectorField.VectorAlgorithm algorithm) Set the vector indexing algorithm (alternative method)Set the field alias (alternative method)withDistanceMetric
(VectorField.DistanceMetric distanceMetric) Set the distance metric (alternative method)withHnswEfConstruction
(int efConstruction) Set the EF_CONSTRUCTION parameter for HNSW algorithm (alternative method)withHnswM
(int m) Set the M parameter for HNSW algorithm (alternative method)
-
Method Details
-
name
Set the field name- Parameters:
name
- Field name- Returns:
- This builder
-
alias
Set the field alias- Parameters:
alias
- Field alias- Returns:
- This builder
-
withAlias
Set the field alias (alternative method)- Parameters:
alias
- Field alias- Returns:
- This builder
-
indexed
Set whether the field is indexed- Parameters:
indexed
- True if indexed- Returns:
- This builder
-
sortable
Set whether the field is sortable- Parameters:
sortable
- True if sortable- Returns:
- This builder
-
dimensions
Set the number of dimensions- Parameters:
dimensions
- Number of dimensions in the vector- Returns:
- This builder
-
algorithm
Set the vector indexing algorithm- Parameters:
algorithm
- Vector algorithm (FLAT or HNSW)- Returns:
- This builder
-
withAlgorithm
Set the vector indexing algorithm (alternative method)- Parameters:
algorithm
- Vector algorithm (FLAT or HNSW)- Returns:
- This builder
-
distanceMetric
Set the distance metric- Parameters:
distanceMetric
- Distance metric (L2, IP, or COSINE)- Returns:
- This builder
-
withDistanceMetric
Set the distance metric (alternative method)- Parameters:
distanceMetric
- Distance metric (L2, IP, or COSINE)- Returns:
- This builder
-
dataType
Set the data type- Parameters:
dataType
- Data type (FLOAT32 or FLOAT64)- Returns:
- This builder
-
initialCapacity
Set the initial capacity for FLAT algorithm- Parameters:
initialCapacity
- Initial capacity- Returns:
- This builder
-
blockSize
Set the block size for FLAT algorithm- Parameters:
blockSize
- Block size- Returns:
- This builder
-
hnswM
Set the M parameter for HNSW algorithm- Parameters:
m
- M parameter- Returns:
- This builder
-
withHnswM
Set the M parameter for HNSW algorithm (alternative method)- Parameters:
m
- M parameter- Returns:
- This builder
-
hnswEfConstruction
Set the EF_CONSTRUCTION parameter for HNSW algorithm- Parameters:
efConstruction
- EF_CONSTRUCTION parameter- Returns:
- This builder
-
withHnswEfConstruction
Set the EF_CONSTRUCTION parameter for HNSW algorithm (alternative method)- Parameters:
efConstruction
- EF_CONSTRUCTION parameter- Returns:
- This builder
-
hnswEfRuntime
Set the EF_RUNTIME parameter for HNSW algorithm- Parameters:
efRuntime
- EF_RUNTIME parameter- Returns:
- This builder
-
epsilon
Set the epsilon parameter for HNSW algorithm- Parameters:
epsilon
- Epsilon parameter- Returns:
- This builder
-
build
Build the VectorField- Returns:
- VectorField instance
-