-
Notifications
You must be signed in to change notification settings - Fork 375
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: implement filters for MongoDBAtlasVectorSearch #1142
Conversation
thucpn
commented
Aug 30, 2024
- Able to populate metadata fields that need for filtering (Done)
- Build mongodb filters based on operator (TODO)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: d8c24ea The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
similarity: "cosine", | ||
}; | ||
|
||
// TODO: Build filters based on the operator |
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.
TODO: Build filters based on the operator
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.
yes, good idea to add this to the PR too
@llamaindex/autotool
@llamaindex/cloud
@llamaindex/community
@llamaindex/core
@llamaindex/env
@llamaindex/experimental
@llamaindex/wasm-tools
llamaindex
commit: |
similarity: "cosine", | ||
}; | ||
|
||
// TODO: Build filters based on the operator |
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.
yes, good idea to add this to the PR too
packages/llamaindex/src/storage/vectorStore/MongoDBAtlasVectorStore.ts
Outdated
Show resolved
Hide resolved
@@ -60,8 +60,7 @@ function toMongoDBFilter(filters?: MetadataFilters): Record<string, any> { | |||
return { $or: filters.filters.map(createFilterObject) }; | |||
} | |||
|
|||
console.debug("filters.condition not recognized. Returning empty object"); | |||
return {}; | |||
throw new Error("filters condition not recognized. Returning empty object"); |
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.
Returning empty object
doesn't make sense anymore, how about:
throw new Error("filters condition not recognized. Returning empty object"); | |
throw new Error("filters condition not recognized. Must be AND or OR"); |