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

Execute dense searches in parallel in OpenSearchDocumentStore when in batch mode #3647

Closed
tstadel opened this issue Nov 30, 2022 · 0 comments · Fixed by #3546
Closed

Execute dense searches in parallel in OpenSearchDocumentStore when in batch mode #3647

tstadel opened this issue Nov 30, 2022 · 0 comments · Fixed by #3546

Comments

@tstadel
Copy link
Member

tstadel commented Nov 30, 2022

Is your feature request related to a problem? Please describe.
If we call run_batch OpenSearchDocumentStore makes use of msearch if it is a sparse query. That is, it executes the searches in parallel. For dense searches this is not the case, all searches are executed in sequence.

Describe the solution you'd like
OpenSearch's msearch supports dense searches as well, so let's:

  • create a batch pendant of query_by_embedding like query_batch for DocumentStores
  • default impl would be to delegate to query_by_embedding
  • for OpenSearchDocumentStore and ElasticsearchDocumentStore implement it to use msearch

Describe alternatives you've considered

Additional context
Parallel searches using msearch substantially speed up batch queries: I measured ~50% latency drop.

@tstadel tstadel changed the title Execute dense searches in parallel in OpenSearchDocumentStore in batch mode Execute dense searches in parallel in OpenSearchDocumentStore when in batch mode Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant