Skip to content
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

Hybrid search fail due to Text_key is stored in a nested field #19

Closed
abdelsalamhamdi opened this issue Nov 27, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@abdelsalamhamdi
Copy link

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

@abdelsalamhamdi abdelsalamhamdi changed the title Hybrid search fail due to Text_key is stored in the nest field Hybrid search fail due to Text_key is stored in a nested field Nov 27, 2024
@blink1073
Copy link
Collaborator

Hi @abdelsalamhamdi, thanks for raising the issue. We're tracking in https://jira.mongodb.org/browse/INTPYTHON-452.

@blink1073 blink1073 added the bug Something isn't working label Dec 16, 2024
@blink1073
Copy link
Collaborator

Fixed in #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants