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] KNNQuery serialize precision error #883

Open
luyuncheng opened this issue Mar 1, 2024 · 0 comments
Open

[BUG] KNNQuery serialize precision error #883

luyuncheng opened this issue Mar 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@luyuncheng
Copy link

luyuncheng commented Mar 1, 2024

What is the bug?

There is a knn query like

KnnQuery origin = new KnnQuery.Builder().field("field").vector(new float[] { 0.1f, 0.4f }).k(1).build();

When it serialize to json string, the result would be:

{"field":{"vector":[0.10000000149011612,0.4000000059604645],"k":1}}

like the test code shows:

public void toBuilderPrecision() {
KnnQuery origin = new KnnQuery.Builder().field("field").vector(new float[] { 0.1f, 0.4f }).k(1).build();
assertEquals(toJson(origin), "{\"field\":{\"vector\":[0.1,0.4],\"k\":1}}");
}

Do you have any additional context?

PR #882

@luyuncheng luyuncheng added bug Something isn't working untriaged labels Mar 1, 2024
@dblock dblock removed the untriaged label Apr 16, 2024
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