Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrievers: should document_store be a private attribute? #69

Closed
anakin87 opened this issue Nov 30, 2023 · 4 comments
Closed

Retrievers: should document_store be a private attribute? #69

anakin87 opened this issue Nov 30, 2023 · 4 comments

Comments

@anakin87
Copy link
Member

  • Retrievers of InMemoryDocumentStore (InMemoryBM25Retriever...) have the attribute document_store

  • Retrievers of Elasticsearch and Opensearch Document Store have the attribute _document_store

We should probably agree on a consistent approach,
so that for example pipeline.get_component("retriever").document_store always works.

@silvanocerza

@silvanocerza
Copy link
Contributor

Yeah, doesn't make much sense for the Document Store to be public. Also if you created an instance of that Component I would expect you must have also built the Document Store it's using.

@masci
Copy link
Contributor

masci commented Dec 11, 2023

What if I'm reading a pipeline from Yaml? I can still get the retriever with pipeline.get_component("retriever") but how do I access the document store?

@silvanocerza
Copy link
Contributor

Good point, that indeed could be a use case. 🤔

@masci
Copy link
Contributor

masci commented Jan 11, 2024

Let's agree that yes, it's ok to expose the document store instance and close this issue.

I'm not sure we should enforce a convention right now, it's an easy fix and we can patch integrations as we need it, but in case you want to schedule some work to uniform the existing document stores, please open another issue with a checklist of what should be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants