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

KnnQuery interface is not complete #2013

Closed
bijela-gora opened this issue Sep 19, 2023 · 3 comments
Closed

KnnQuery interface is not complete #2013

bijela-gora opened this issue Sep 19, 2023 · 3 comments
Assignees

Comments

@bijela-gora
Copy link

🐛 Bug Report

According to the documentation the KnnQuery interface must contain optional property similarity (type float).

Because of the missing similarity property on KnnQuery interface it is inconvenient to use .search API:

Screenshot from 2023-09-19 23-59-47

Additionally to that k and num_candidates properties should have type of integer.

Expected behavior

export interface KnnQuery {
  field: Field
  query_vector?: QueryVector
  query_vector_builder?: QueryVectorBuilder
  k: integer
  num_candidates: integer
  similarity?: float
  boost?: float
  filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
}
@JoshMock
Copy link
Member

Thanks for the report! I'll take a look soon.

Most type definitions in this repo are automatically generated using the specification Elastic maintains in the elastic/elasticsearch-specificaton repo. I'll see if the issue can be resolved there first, so that all clients can benefit from the improvement.

In the meantime, as with any build-time TypeScript error, you can always use ignore instructions to skip over typing bugs that you know will not result in errors at runtime.

@JoshMock JoshMock self-assigned this Sep 21, 2023
@bijela-gora
Copy link
Author

@JoshMock hi

Thanks for your time and attention here.

There is event PR opened elastic/elasticsearch-specification#2261 and I think it is ready to be merged. But I added small suggestion: elastic/elasticsearch-specification#2261 (comment)

@JoshMock
Copy link
Member

elastic/elasticsearch-specification#2261 is merged and backported. This will be fixed in upcoming patch and minor version releases.

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

2 participants