Skip to content

Commit

Permalink
community[patch]: Fix MongoDBAtlasVectorSearch max_marginal_relevance…
Browse files Browse the repository at this point in the history
…_search (#17971)

Description:
* `self._embedding_key` is accessed after deletion, breaking
`max_marginal_relevance_search` search
* Introduced in:
e135e52
* Updated but still persists in:
ce22e10

Issue: #17963

Co-authored-by: Bagatur <baskaryan@gmail.com>
  • Loading branch information
certified-dodo and baskaryan committed Mar 1, 2024
1 parent 9f2ab37 commit 43e3244
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def _similarity_search_with_score(
for res in cursor:
text = res.pop(self._text_key)
score = res.pop("score")
del res[self._embedding_key]
docs.append((Document(page_content=text, metadata=res), score))
return docs

Expand Down

0 comments on commit 43e3244

Please sign in to comment.