public class VectorField extends SchemaField
| Modifier and Type | Class and Description |
|---|---|
static class |
VectorField.Builder
Builder class for constructing VectorField instances using the builder pattern.
|
static class |
VectorField.VectorAlgorithm
Enumeration of supported vector indexing algorithms in Redis.
|
fieldName| Constructor and Description |
|---|
VectorField(FieldName fieldName,
VectorField.VectorAlgorithm algorithm,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new VectorField with the specified field name, algorithm, and attributes.
|
VectorField(java.lang.String fieldName,
VectorField.VectorAlgorithm algorithm,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new VectorField with the specified field name, algorithm, and attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParams(CommandArguments args)
Adds the vector field parameters to the Redis command arguments.
|
VectorField |
as(java.lang.String attribute)
Sets an alias for this field that can be used in queries instead of the field name.
|
static VectorField.Builder |
builder()
Creates a new Builder instance for constructing VectorField objects using the builder pattern.
|
VectorField |
indexMissing()
Configures the field to handle missing values during indexing.
|
getFieldName, getNamepublic VectorField(java.lang.String fieldName,
VectorField.VectorAlgorithm algorithm,
java.util.Map<java.lang.String,java.lang.Object> attributes)
fieldName - the name of the vector field in the indexalgorithm - the vector indexing algorithm to useattributes - the algorithm-specific configuration attributesjava.lang.IllegalArgumentException - if required attributes are missing or invalidpublic VectorField(FieldName fieldName, VectorField.VectorAlgorithm algorithm, java.util.Map<java.lang.String,java.lang.Object> attributes)
fieldName - the field name object containing the field name and optional aliasalgorithm - the vector indexing algorithm to useattributes - the algorithm-specific configuration attributesjava.lang.IllegalArgumentException - if required attributes are missing or invalidfor detailed attribute documentationpublic VectorField as(java.lang.String attribute)
as in class SchemaFieldattribute - the alias name to use for this field in queriespublic VectorField indexMissing()
This is useful when not all documents in your dataset contain vector embeddings, but you still want to index them for other types of searches.
public void addParams(CommandArguments args)
args - the command arguments to add parameters topublic static VectorField.Builder builder()
Copyright © 2025. All rights reserved.