-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to perform knn query [knn] unknown field [k #8124
Comments
Hello! This is a known issue in the Elasticsearch specification that will be fixed in the next version of the .NET client: elastic/elasticsearch-specification#2490. Sorry about that. |
Is an older version of the driver that works with it? Actually this is pretty a blocking issue in a project of mine because we are planning to use Elastic as vector search..... |
As @pquentin said, it's already fixed in the specification. The fix will propagate to the .NET client in the next few days. There is no older version of the 8.* client that correctly supports KNN queries. Hope you don't mind waiting a couple of days 🙂 I'll try to do a patch release already today, but can't promise anything. |
Many thanks!!! |
Fixed in 8.13.6 |
Confirmed! All test are green now on my project. Thanks again!!! |
@alkampfergit Happy to help you out 🙂 As well thanks to @l-trotta for fixing this issue upstream in the specification. |
Elastic.Clients.Elasticsearch version:
Elasticsearch version:
8.13.0
.NET runtime version:
.NET 8
Operating system version:
Windows 11
Description of the problem including expected versus actual behavior:
I've created a knn query with the following syntax
Then I got an error: ServerError: Type: x_content_parse_exception Reason: "[9:7] [knn] unknown field [k]"
Looking for generated query it contains a k value that it is not supported: this is the request where you can see a k : 0 that is not correct. If I remove that parameter and try to execute the query everything seems to work just fine.
Indeed the driver has that parameter in the request, but seems not to be understood by the server. I'm constructing the query from a QueryDescriptor() object.
Am I doing something wrong or the driver indeed add a wrong "k" argument to the query?
The text was updated successfully, but these errors were encountered: