Closed tillwf closed 3 months ago
I cannot reproduce the bug.
What I did:
create a new database (test
) and collection (test
)
create a new index (vector_index
) with the same configuration as yours:
{
"fields":[
{
"type": "vector",
"path": "embedding",
"numDimensions": 384,
"similarity": "cosine"
}
]
}
run the following script
from haystack_integrations.components.retrievers.mongodb_atlas import MongoDBAtlasEmbeddingRetriever
from haystack_integrations.document_stores.mongodb_atlas import MongoDBAtlasDocumentStore
import os
from haystack.dataclasses import Document
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
os.environ["MONGO_CONNECTION_STRING"]="..."
document_store = MongoDBAtlasDocumentStore( database_name="test", collection_name="test", vector_search_index="vector_index", )
docs = [Document(content="This is a test", meta={"name": "test"}), Document(content="this is a document about dogs", meta={"name": "dog_doc"}), Document(content="this is a document about cats", meta={"name": "cat_doc"})]
embedder = SentenceTransformersDocumentEmbedder(model="BAAI/bge-small-en-v1.5") embedder.warm_up()
docs_with_embeddings = embedder.run(docs)["documents"]
print(document_store.write_documents(docs_with_embeddings))
retriever = MongoDBAtlasEmbeddingRetriever(document_store=document_store, top_k=3) results = retriever.run(query_embedding=[0.1]*384) print(results)
I also tried a more complex example, with a Retrieval Pipeline with a Text Embedder and a Ranker, but I cannot reproduce the error.
@tillwf I'm closing the issue. Feel free to reopen it and add more details if the problem persists.
Describe the bug Like this bug: https://github.com/deepset-ai/haystack/issues/7031 but with
haystack-ai==2.0.0
Error message
To Reproduce Here is a simple code to reproduce:
Here is a screen of my index I made:![image](https://github.com/deepset-ai/haystack/assets/7115035/b4acf140-8a80-4f75-bcb6-09baf69483dd)
and the code I used to create it:
FAQ Check
System: