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

feat(community): ElasticVectorSearch: add a not_exists filter #7036

Conversation

LaurensTsestigh
Copy link
Contributor

We have recently implemented a new functionality in our application where the customer is able to archive items.
As we want to exclude archived items by default from our vectorstore search we need a filter to add a statement to the must_not filtering being a must_not exists and then we pass { field: 'archivedAt', operator: 'not_exists' } .
If we then want to include archived items later one, we can just not pass this filter.

I think by adding this custom check, we add a lot of flexibility to the similarity search as well.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Oct 21, 2024
Copy link

vercel bot commented Oct 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Oct 22, 2024 8:04am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Oct 22, 2024 8:04am

@dosubot dosubot bot added the auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs label Oct 21, 2024
@jacoblee93
Copy link
Collaborator

Looks good - could you add an integration test illustrating desired behavior?

@jacoblee93 jacoblee93 added the close PRs that need one or two touch-ups to be ready label Oct 21, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Oct 22, 2024
@LaurensTsestigh
Copy link
Contributor Author

Looks good - could you add an integration test illustrating desired behavior?

Sure, I've added/adapted the tests!

@jacoblee93
Copy link
Collaborator

Thank you!

@jacoblee93 jacoblee93 changed the title ElasticVectorSearch: add a not_exists filter feat(community): ElasticVectorSearch: add a not_exists filter Oct 23, 2024
@jacoblee93 jacoblee93 added the lgtm PRs that are ready to be merged as-is label Oct 23, 2024
@jacoblee93 jacoblee93 merged commit 59217da into langchain-ai:main Oct 23, 2024
32 checks passed
@LaurensTsestigh
Copy link
Contributor Author

Thank you!

My pleasure, thank you for taking your time!

cdierkens pushed a commit to cdierkens/langchainjs that referenced this pull request Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs close PRs that need one or two touch-ups to be ready lgtm PRs that are ready to be merged as-is size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants