mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 16:13:25 +00:00
[Community]: FIxed the DocumentDBVectorSearch _similarity_search_without_score
(#22970)
- **Description:** The PR #22777 introduced a bug in `_similarity_search_without_score` which was raising the `OperationFailure` error. The mistake was syntax error for MongoDB pipeline which has been corrected now. - **Issue:** #22770
This commit is contained in:
parent
f01f12ce1e
commit
bf839676c7
@ -328,8 +328,8 @@ class DocumentDBVectorSearch(VectorStore):
|
|||||||
A list of documents closest to the query vector
|
A list of documents closest to the query vector
|
||||||
"""
|
"""
|
||||||
pipeline: List[dict[str, Any]] = [
|
pipeline: List[dict[str, Any]] = [
|
||||||
|
{"$match": filter},
|
||||||
{
|
{
|
||||||
"$match": filter,
|
|
||||||
"$search": {
|
"$search": {
|
||||||
"vectorSearch": {
|
"vectorSearch": {
|
||||||
"vector": embeddings,
|
"vector": embeddings,
|
||||||
@ -339,7 +339,7 @@ class DocumentDBVectorSearch(VectorStore):
|
|||||||
"efSearch": ef_search,
|
"efSearch": ef_search,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
cursor = self._collection.aggregate(pipeline)
|
cursor = self._collection.aggregate(pipeline)
|
||||||
|
Loading…
Reference in New Issue
Block a user