milvus-sdk-go
milvus-sdk-go copied to clipboard
Not able to insert in milvus collection
I am using a simple program to insert data into milvus.
// row-base covert to column-base
ids := make([]int64, 0, 1)
ids = append(ids, 23)
vectors := make([][]float32, 0, 1)
vectors = append(vectors, ip.GetVector())
var entities []milvus.Entity
entities = []milvus.Entity{{
FloatData: []float32{float32(10.3232)},
}}
//index(context.Background(), collectionName)
result, status, err := Client.Insert(context.Background(), &milvus.InsertParam{
CollectionName: collectionName,
RecordArray: entities,
IDArray: ids,
PartitionTag: "hi",
})
if err != nil {
log.Println("failed to create collection:", err.Error())
}
if !status.Ok() {
fmt.Errorf("error inserting vectors %v: %v", collectionName, status.GetStatus())
}
status, err = Client.Flush(context.Background(), []string{collectionName})
if err != nil {
log.Fatal("failed to flush collection:", err.Error())
}
if !status.Ok() {
fmt.Errorf("error flushing vectors %v: %v", collectionName, status.GetStatus())
}
log.Println("flush completed")
for _, v := range result {
fmt.Printf("result after insertion %+v\n", v)
}
Their is no error also after inserting and flushing. Still the entity is not inserted into the collection. Can anyone help
Hi @AnandKumarTokopedia. Thanks for the reply. From the code snippet, it seems that you are using 1.X SDK. Are you using 1.X milvus instance?
@congqixia Can you please help let me know how to check that
@congqixia Can you please help let me know how to check that
@AnandKumarTokopedia How did you install Milvus? Using Docker image or just built it from source code?
It was using docker @congqixia
It was using docker @congqixia
@AnandKumarTokopedia then could you please provide the docker logs from milvus container?