milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
326 stars 105 forks source link

[Bug]: AutoID field, unable to set default start value? #742

Open vultj opened 4 months ago

vultj commented 4 months ago

Is there an existing issue for this?

Current Behavior

Current behavior appears that auto id fields start at an arbitrary number? For example a few entries:

[{'id': 4491....482}, {'id': 4491....484}

Expected Behavior

Would like to be able to set the starting value for this field, such as 0 so that its more predictable to search over.

Steps To Reproduce

schema := entity.Schema{
  CollectionName: "test",
  AutoID: true,
  Fields: []*entity.Field{
    Name: "id",
    DataType: entity.FieldTypeInt64,
    PrimaryKey: true
    AutoID: true
  },
}

Insert some data, then `query` with milvus-cli

Environment

No response

Anything else?

No response

vultj commented 4 months ago

I also want to add that the auto_id values are so high that unmarshalling them to JSON can result in the same ID being shown for multiple records https://github.com/golang/go/issues/5562