[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
pull/23068/head
Mohammad Mohtashim 4 months ago committed by GitHub
parent f01f12ce1e
commit bf839676c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -328,8 +328,8 @@ class DocumentDBVectorSearch(VectorStore):
A list of documents closest to the query vector
"""
pipeline: List[dict[str, Any]] = [
{"$match": filter},
{
"$match": filter,
"$search": {
"vectorSearch": {
"vector": embeddings,
@ -339,7 +339,7 @@ class DocumentDBVectorSearch(VectorStore):
"efSearch": ef_search,
}
},
}
},
]
cursor = self._collection.aggregate(pipeline)

Loading…
Cancel
Save