spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

docs: Edit Auto-configuration Example

Open cyPark95 opened this issue 1 year ago • 0 comments

Corrected the variable passed to vectorStore.add() from List.of(document) to documents.

Original Code:

List <Document> documents = List.of(
    new Document("Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!!", Map.of("meta1", "meta1")),
    new Document("The World is Big and Salvation Lurks Around the Corner"),
    new Document("You walk forward facing the past and you turn back toward the future.", Map.of("meta2", "meta2")));

// Add the documents to Redis
vectorStore.add(List.of(document));

Corrected Code:

List <Document> documents = List.of(
    new Document("Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!!", Map.of("meta1", "meta1")),
    new Document("The World is Big and Salvation Lurks Around the Corner"),
    new Document("You walk forward facing the past and you turn back toward the future.", Map.of("meta2", "meta2")));

// Add the documents to Redis
vectorStore.add(documents);

cyPark95 avatar Aug 06 '24 04:08 cyPark95