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

Wrong arguments count in VectorField #70

Closed
MatteoMilanese opened this issue Jan 26, 2023 · 1 comment · Fixed by #72
Closed

Wrong arguments count in VectorField #70

MatteoMilanese opened this issue Jan 26, 2023 · 1 comment · Fixed by #72
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@MatteoMilanese
Copy link

MatteoMilanese commented Jan 26, 2023

When creating a new vector field through Schema.AddVectorField the generated command has a wrong number of parameters.

Example:

var schema = new Schema().AddVectorField("fieldTest", Schema.VectorField.VectorAlgo.HNSW, new Dictionary<string, object>()
{
    ["TYPE"] = "FLOAT32",
    ["DIM"] = "128",
    ["DISTANCE_METRIC"] = "COSINE"
});

which generates the following:

FT.CREATE test SCHEMA fieldTest VECTOR HNSW 3 TYPE FLOAT32 DIM 128 DISTANCE_METRIC COSINE

and it should be

FT.CREATE test SCHEMA fieldTest VECTOR HNSW 6 TYPE FLOAT32 DIM 128 DISTANCE_METRIC COSINE

The error in the code is at this line which only takes into account dictionary's keys while should consider also values (i.e.: Attributes.Count() should be doubled).

@MatteoMilanese MatteoMilanese changed the title Wrong argument number in VectorField Wrong arguments count in VectorField Jan 26, 2023
@shacharPash shacharPash added bug Something isn't working good first issue Good for newcomers labels Jan 26, 2023
@shacharPash
Copy link
Contributor

Hey @MatteoMilanese ,
Thanks, that’s indeed an issue.
I'll fix it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants