Skip to content

Wrong arguments count in VectorField #70

@MatteoMilanese

Description

@MatteoMilanese

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions