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

KNN search query format changed in elasticsearch 8.17.0? #2159

Open
yp05327 opened this issue Jan 18, 2025 · 0 comments
Open

KNN search query format changed in elasticsearch 8.17.0? #2159

yp05327 opened this issue Jan 18, 2025 · 0 comments

Comments

@yp05327
Copy link

yp05327 commented Jan 18, 2025

🐛 Describe the bug

elasticsearch.BadRequestError: BadRequestError(400, 'x_content_parse_exception', '[1:80] [knn] unknown field [vector]')

I got this error when exec add memory function.
I'm using the latest version 8.17.0.

According to the document about knn search in elasticsearch. It seems that the format of search query has been changed?

The search query in mem0:

# KNN vector search
{"knn": {"vector": {"vector": query, "k": limit}}},

I change the query into:

"knn": {
    "field": "embedding",
    "query_vector":  query,
    "k": limit
}

Then it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant