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>
  • Method Details

    • indexName

      public RedisVectorStore.Builder indexName(String indexName)
      Sets the Redis index name.
      Parameters:
      indexName - the index name to use
      Returns:
      the builder instance
    • prefix

      public RedisVectorStore.Builder prefix(String prefix)
      Sets the Redis key prefix (default: "embedding:").
      Parameters:
      prefix - the prefix to use
      Returns:
      the builder instance
    • contentFieldName

      public RedisVectorStore.Builder contentFieldName(String fieldName)
      Sets the Redis content field name.
      Parameters:
      fieldName - the content field name to use
      Returns:
      the builder instance
    • embeddingFieldName

      public RedisVectorStore.Builder embeddingFieldName(String fieldName)
      Sets the Redis embedding field name.
      Parameters:
      fieldName - the embedding field name to use
      Returns:
      the builder instance
    • vectorAlgorithm

      public RedisVectorStore.Builder vectorAlgorithm(@Nullable RedisVectorStore.Algorithm algorithm)
      Sets the Redis vector algorithm.
      Parameters:
      algorithm - the vector algorithm to use
      Returns:
      the builder instance
    • metadataFields

      public RedisVectorStore.Builder metadataFields(RedisVectorStore.MetadataField... fields)
      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

      public RedisVectorStore.Builder initializeSchema(boolean initializeSchema)
      Sets whether to initialize the schema.
      Parameters:
      initializeSchema - true to initialize schema, false otherwise
      Returns:
      the builder instance
    • build

      public RedisVectorStore build()