Skip to content

Can't get vectorStoreTest with MongoDBAtlasVectorStore to work locally #1573

Open
@jrgleason

Description

@jrgleason

Bug description
I am having trouble with MongoDBAtlasVectorStore. Basically when I copy and paste this into my project because the similarity search isn't working...

List<Document> ds = List.of(
                new Document(
                        "Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!!",
                        Collections.singletonMap("meta1", "meta1")),
                new Document("Hello World Hello World Hello World Hello World Hello World Hello World Hello World"),
                new Document(
                        "Great Depression Great Depression Great Depression Great Depression Great Depression Great Depression",
                        Collections.singletonMap("meta2", "meta2")));

        vectorStore.add(ds);
        Thread.sleep(25000); // Await a second for the document to be indexed

        List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Great").withTopK(1));

The result I see is not correct...

image

Environment
Java 23
Spring AI 1.0.0-M3

Steps to reproduce
See repo here. You can add the code above to that and see it doesn't work

Expected behavior
I would expect it to return a document as it does in the test.

Minimal Complete Reproducible example
See above more available here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions