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

Integrate filters with knn queries in OpenDistroElasticsearchDocumentStore #1301

Merged
merged 3 commits into from
Aug 3, 2021
Merged

Conversation

dfhssilva
Copy link
Contributor

Allows the use of filters coupled with knn similarity search on OpenDistroElasticsearchDocumentStore instances. Fixes #1139.

Proposed changes:

  • Overwrite the query_by_embedding method of the parent ElasticsearchDocumentStore class. This change solves the KeyError: 'script_score' received, when trying to pass a filter in calling the method on an ElasticsearchDocumentStore instance.

This is my first contribution for an open source project. If something is missing please let me know.

Status (please check what you already did):

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

dfhssilva and others added 2 commits July 22, 2021 00:18
Allows the use of filters coupled with knn similarity search on
OpenDistroElasticsearchDocumentStore instances. Fixes #1139.
@tholor tholor requested a review from brandenchan August 2, 2021 09:23
Copy link
Contributor

@brandenchan brandenchan left a comment

Choose a reason for hiding this comment

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

Tested this with a minimal example and it is working! LGTM

@brandenchan
Copy link
Contributor

Thanks for your work on this @dfhssilva !

@brandenchan brandenchan merged commit fb4a417 into deepset-ai:master Aug 3, 2021
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

Successfully merging this pull request may close these issues.

Filters in K-NN similarity search query not working (Open Distro Elastic Search)
2 participants