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

[BUG] Cannot run hybrid searches #953

Closed
kgreen24 opened this issue Jan 6, 2025 · 4 comments
Closed

[BUG] Cannot run hybrid searches #953

kgreen24 opened this issue Jan 6, 2025 · 4 comments
Labels
🐛 bug Something isn't working

Comments

@kgreen24
Copy link

kgreen24 commented Jan 6, 2025

What is the bug?

I'm trying to run a hybrid match + knn search. Knn searches work fine but when I try to run a hybrid query I get the following response:

EXCEPTION: ResponseError: parsing_exception: [parsing_exception] Reason: unknown query [hybrid]

How can one reproduce the bug?

I'm sending in the following request to the search method:

        const query = {
            index: indexName,
            body: {
                query: {
                    hybrid: {
                        queries: [
                            {
                                match: {
                                    embeddedText
                                }
                            },
                            {
                                knn: {
                                    embedding: {
                                        vector,
                                        k
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        };

What is the expected behavior?

I would expect to get a response per this document: https://opensearch.org/docs/latest/search-plugins/hybrid-search/

What is your host/environment?

I'm using 2.13.0 of this package on node 18 running on Windows. I'm connecting to an OpenSearch v 2.5 instance

Do you have any screenshots?

Do you have any additional context?

This is my first day of trying to attempt this, so it's very possible that I just don't understand something. But wanted to ask anyway. I also saw the article was talking about query search pipelines. I have yet to set one of those up or refer to one. Hopefully that's not the issue.

@dblock
Copy link
Member

dblock commented Jan 7, 2025

@kgreen24 Let's narrow this down. Does this query work with curl and fails with the client? Is this a local docker instance of OpenSearch or a managed service?

@dblock dblock added 🐛 bug Something isn't working and removed untriaged labels Jan 7, 2025
@kgreen24
Copy link
Author

kgreen24 commented Jan 7, 2025

@kgreen24 Let's narrow this down. Does this query work with curl and fails with the client? Is this a local docker instance of OpenSearch or a managed service?

Hey, I'm starting to think that this issue is happening because our opensearch is at 2.5 and I don't even think hybrid search was supported until 2.11.

But to answer the question, its a managed service and i can't even get the query to work there.

@dblock
Copy link
Member

dblock commented Jan 7, 2025

Hey, I'm starting to think that this issue is happening because our opensearch is at 2.5 and I don't even think hybrid search was supported until 2.11.

That would make sense.

@kgreen24 Try it locally with docker with the latest just to confirm? Should take a few minutes. https://opensearch.org/versions/opensearch-2-18-0.html

@kgreen24
Copy link
Author

kgreen24 commented Jan 7, 2025

I confirmed this is working fine in at least v 2.17, I updated our managed service before I saw the previous suggestion about docker testing. Closing. Sorry for the noise.

@dblock thank you for responding.

@kgreen24 kgreen24 closed this as completed Jan 7, 2025
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