Closed
Description
When performing the hybrid search the following code in libs/mongodb/langchain_mongodb/retrievers/hybrid_search.py
cause a key value error if the text_key is a nested filed example title.text
# Formatting
docs = []
for res in cursor:
text = res.pop(self.vectorstore._text_key)
# score = res.pop("score") # The score remains buried!
make_serializable(res)
docs.append(Document(page_content=text, metadata=res))
return docs