deepset-ai / haystack-integrations

🚀 A list of Haystack Integrations, maintained by the community or deepset.
44 stars 54 forks source link

Embedded vectors returned as None despite setting return_embedding to True in MongoDBAtlasDocumentStore #184

Closed TechnoRahmon closed 4 months ago

TechnoRahmon commented 4 months ago

Description:

I'm encountering an issue with the MongoDBAtlasDocumentStore in the Haystack library. Despite setting return_embedding=True in the configuration, embedded vectors are returned as None when retrieving documents from the MongoDB collection.

Steps to Reproduce:

  1. Set up a MongoDBAtlasDocumentStore with the following configuration:
from haystack.document_stores.mongodb_atlas import MongoDBAtlasDocumentStore

ds = MongoDBAtlasDocumentStore(
    mongo_connection_string="mongo_connection_string",
    database_name="squadDB",
    collection_name="dev",
    vector_search_index="vector_search_index",
    return_embedding=True,
    similarity='dotProduct'
)
  1. Save documents to the MongoDB collection using ds.write_documents(squad_docs).

  2. Retrieve documents from the collection using ds.get_all_documents().

  3. Check the embedding of the retrieved documents, e.g., all_docs[0]['embedding'].

Expected Behavior:

The embedding field of the retrieved documents should contain the embedded vectors.

Actual Behavior:

The embedding field of the retrieved documents is None, despite setting return_embedding=True in the configuration.

Additional Information:

anakin87 commented 4 months ago

Closing as duplicate of https://github.com/deepset-ai/haystack/issues/7037