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

Required parameter K in KnnQuery #774

Closed
AJStorteeboom opened this issue Apr 4, 2024 · 6 comments
Closed

Required parameter K in KnnQuery #774

AJStorteeboom opened this issue Apr 4, 2024 · 6 comments
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@AJStorteeboom
Copy link

Java API client version

8.13

Java version

17

Elasticsearch Version

12

Problem description

I am trying to execute a KnnQuery (Knn query | Elasticsearch Guide [8.13] | Elastic 1) in my java application

(So not the knn search: k-nearest neighbor (kNN) search | Elasticsearch Guide [8.13] | Elastic).

When you use knn in a query, you can't set parameter k since the size parameter is used.

But, the Java client with version 8.13 requires the k parameter: (co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'KnnQuery.k' )

So my problem is kind of a deadlock. Elasticsearch doesn't support the k parameter when knn is used in a query, but the java client requires the k parameter.

image

I've posted it on the forum of elastic and they told me to create an issue since it is a bug: https://discuss.elastic.co/t/knnquery-in-java-client/356645

@l-trotta
Copy link
Contributor

l-trotta commented Apr 4, 2024

Hello, thank you for the report! This is an issue in the API specification used to produce the Java code, we'll fix it and then regenerate the client to solve this.

@l-trotta l-trotta added the Area: Specification Related to the API spec used to generate client code label Apr 4, 2024
@jerryguowei
Copy link

Is there an update on when we release this fix?

@l-trotta
Copy link
Contributor

It was recently fixed in the spec with this PR, so it should be in the next release of the client.

@elias-fauser
Copy link

@l-trotta We are very happy the issue was quickly fixed. We are currently actively waiting for this fix in order to deploy a query update. Is there any information on when the next release will take place?

@l-trotta
Copy link
Contributor

there should be a new release before the end of next month, I'll ping you in case of an earlier release.

@l-trotta
Copy link
Contributor

l-trotta commented May 6, 2024

fixed in 8.13.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

No branches or pull requests

4 participants