Class RedisVectorStore.Builder
java.lang.Object
org.springframework.ai.vectorstore.AbstractVectorStoreBuilder<RedisVectorStore.Builder>
org.springframework.ai.vectorstore.redis.RedisVectorStore.Builder
- All Implemented Interfaces:
org.springframework.ai.vectorstore.VectorStore.Builder<RedisVectorStore.Builder>
- Enclosing class:
- RedisVectorStore
public static class RedisVectorStore.Builder
extends org.springframework.ai.vectorstore.AbstractVectorStoreBuilder<RedisVectorStore.Builder>
-
Field Summary
Fields inherited from class org.springframework.ai.vectorstore.AbstractVectorStoreBuilder
batchingStrategy, customObservationConvention, embeddingModel, observationRegistry -
Method Summary
Modifier and TypeMethodDescriptionbuild()contentFieldName(String fieldName) Sets the Redis content field name.embeddingFieldName(String fieldName) Sets the Redis embedding field name.Sets the Redis index name.initializeSchema(boolean initializeSchema) Sets whether to initialize the schema.Sets the metadata fields.metadataFields(RedisVectorStore.MetadataField... fields) Sets the metadata fields.Sets the Redis key prefix (default: "embedding:").vectorAlgorithm(RedisVectorStore.Algorithm algorithm) Sets the Redis vector algorithm.Methods inherited from class org.springframework.ai.vectorstore.AbstractVectorStoreBuilder
batchingStrategy, customObservationConvention, getBatchingStrategy, getCustomObservationConvention, getEmbeddingModel, getObservationRegistry, observationRegistry, self
-
Method Details
-
indexName
Sets the Redis index name.- Parameters:
indexName- the index name to use- Returns:
- the builder instance
-
prefix
Sets the Redis key prefix (default: "embedding:").- Parameters:
prefix- the prefix to use- Returns:
- the builder instance
-
contentFieldName
Sets the Redis content field name.- Parameters:
fieldName- the content field name to use- Returns:
- the builder instance
-
embeddingFieldName
Sets the Redis embedding field name.- Parameters:
fieldName- the embedding field name to use- Returns:
- the builder instance
-
vectorAlgorithm
Sets the Redis vector algorithm.- Parameters:
algorithm- the vector algorithm to use- Returns:
- the builder instance
-
metadataFields
Sets the metadata fields.- Parameters:
fields- the metadata fields to include- Returns:
- the builder instance
-
metadataFields
public RedisVectorStore.Builder metadataFields(@Nullable List<RedisVectorStore.MetadataField> fields) Sets the metadata fields.- Parameters:
fields- the list of metadata fields to include- Returns:
- the builder instance
-
initializeSchema
Sets whether to initialize the schema.- Parameters:
initializeSchema- true to initialize schema, false otherwise- Returns:
- the builder instance
-
build
-