-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use ElasticsearchDocumentStore.get_all_documents
in ElasticsearchFilterOnlyRetriever.retrieve
#2151
Use ElasticsearchDocumentStore.get_all_documents
in ElasticsearchFilterOnlyRetriever.retrieve
#2151
Conversation
The tests around retrievers are a bit confusing to me - would love some pointers on how to test this change. |
Hi @adri1wald sure, I think it would be nice to add a new test case here that is parameterized with an
There you could add let's say 12 documents of which 11 documents should be selected by the filter. If all 11 are returned, the test passes. Any other idea? |
Hey @adri1wald, do you think you'll have time to work on this PR or shall we take over, apply the last touches and merge? |
Hey @ZanSara, really sorry I completely forgot about this PR :’) I will make some time this weekend to finish it off! |
Great, thanks! 🙂 |
Hi @adri1wald it would be really nice to include your changes in the next release. Do you think you could make the final changes by the end of next week (end of April)? |
…ive-filter-only-retriever
…github.com/adri1wald/haystack into features/alternative-filter-only-retriever
Hey, major apologies for the delay. I've added the test case now. Let me know if there's anything else that needs doing! |
Hi @adri1wald thanks for adding the test. Right now, it's failing because of the following line of code:
Currently, the retrieve method has no default value for query and therefore the test fails. |
…github.com/adri1wald/haystack into features/alternative-filter-only-retriever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, ready to merge! 👍 Thank you @adri1wald for your contribution!
Closes #2139
Proposed changes:
ElasticsearchFilterOnlyRetriever.retrieve
usedElasticsearchDocumentStore.query
, which takes atop_k
parameter but doesn't apply it to the es requestbody
on theif query is None
branch.top_k
doesn't have semantic meaning without a query anyways, because there is nothing to score agains and thus no ordering over which to select the top k documents.top_k
at all"ElasticsearchFilterOnlyRetriever.retrieve
therefore now usesElasticsearchDocumentStore.get_all_documents
, which returns all documents matching the filters.Status (please check what you already did):