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

fix: get_documents_by_id should return docs for all passed ids #2064

Merged
merged 6 commits into from
Jan 26, 2022

Conversation

mathislucka
Copy link
Member

Proposed changes:

  • The ElasticsearchDoumentStore 's get_all_documents_by_id method should return documents for all ids that where passed in. Previously, a maximum of 10 documents was returned.

Status (please check what you already did):

  • First draft (up for discussions & feedback)
  • [x ] Final code
  • [ x] Added tests
  • [ x] Updated documentation

Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I think it's a good fix that aligns the behavior of the different document stores. However, if a user passes 10,000 ids we could run into performance problems so let's keep an eye on any trouble caused by this.

"""Fetch documents by specifying a list of text id strings"""
"""
Fetch documents by specifying a list of text id strings. Be aware that passing a large number of ids might lead
to performance issues.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could mention here that the maximum is 10,000 (with elasticsearch). We might even limit that further to prevent performance issues.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a short sentence about the 10k ES default limit. And I think it's a good idea to monitor first before limiting it for performance reasons. If we decide to limit this we should probably also limit other queries, shouldn't we?

@mathislucka mathislucka merged commit 5b7e906 into master Jan 26, 2022
@mathislucka mathislucka deleted the fix/get_documents_by_id branch January 26, 2022 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:document_store type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants