Package com.redis.vl.schema
Class IndexSchema.Builder
java.lang.Object
com.redis.vl.schema.IndexSchema.Builder
- Enclosing class:
IndexSchema
Builder for IndexSchema
-
Method Summary
Modifier and TypeMethodDescriptionaddNumericField
(String name, Consumer<NumericField.NumericFieldBuilder> customizer) Add a numeric field with customizationaddTagField
(String name, Consumer<TagField.TagFieldBuilder> customizer) Add a tag field with customizationaddTextField
(String name, Consumer<TextField.TextFieldBuilder> customizer) Add a text field with customizationaddVectorField
(String name, int dimensions, Consumer<VectorField.VectorFieldBuilder> customizer) Add a vector field with customizationbuild()
Build the IndexSchemaAdd a field to the schemaindex
(IndexSchema.Index index) Set the builder from an Index configurationSet the index nameSet the key prefixstorageType
(IndexSchema.StorageType storageType) Set the storage typewithPrefix
(String prefix) Set the key prefix (alias for prefix)withStorageType
(IndexSchema.StorageType storageType) Set the storage type (alias for storageType)
-
Method Details
-
name
Set the index name- Parameters:
name
- the index name- Returns:
- this builder
-
prefix
Set the key prefix- Parameters:
prefix
- the key prefix- Returns:
- this builder
-
withPrefix
Set the key prefix (alias for prefix)- Parameters:
prefix
- the key prefix- Returns:
- this builder
-
storageType
Set the storage type- Parameters:
storageType
- the storage type- Returns:
- this builder
-
withStorageType
Set the storage type (alias for storageType)- Parameters:
storageType
- the storage type- Returns:
- this builder
-
field
Add a field to the schema- Parameters:
field
- the field to add- Returns:
- this builder
-
addTextField
public IndexSchema.Builder addTextField(String name, Consumer<TextField.TextFieldBuilder> customizer) Add a text field with customization- Parameters:
name
- the field namecustomizer
- consumer to customize the field builder- Returns:
- this builder
-
addTagField
Add a tag field with customization- Parameters:
name
- the field namecustomizer
- consumer to customize the field builder- Returns:
- this builder
-
addNumericField
public IndexSchema.Builder addNumericField(String name, Consumer<NumericField.NumericFieldBuilder> customizer) Add a numeric field with customization- Parameters:
name
- the field namecustomizer
- consumer to customize the field builder- Returns:
- this builder
-
addVectorField
public IndexSchema.Builder addVectorField(String name, int dimensions, Consumer<VectorField.VectorFieldBuilder> customizer) Add a vector field with customization- Parameters:
name
- the field namedimensions
- the vector dimensionscustomizer
- consumer to customize the field builder- Returns:
- this builder
-
build
Build the IndexSchema- Returns:
- the constructed IndexSchema
-
index
Set the builder from an Index configuration- Parameters:
index
- the Index configuration to use- Returns:
- this builder
-