Skip to content

Commit

Permalink
fixing: failed to load collection error
Browse files Browse the repository at this point in the history
Signed-off-by: Sidharh Suvarna <[email protected]>
Signed-off-by: Sidharth <[email protected]>
  • Loading branch information
sidharths-uc committed Jun 14, 2024
1 parent 95550a5 commit a6c70a4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ func main() {
}
log.Println("flush completed")

// Now add index
idx, err := entity.NewIndexIvfFlat(entity.L2, 2)
if err != nil {
log.Fatal("fail to create ivf flat index:", err.Error())
}
err = c.CreateIndex(ctx, collectionName, "Vector", idx, false)
if err != nil {
log.Fatal("fail to create index:", err.Error())
}

// load collection with async=false
err = c.LoadCollection(ctx, collectionName, false)
if err != nil {
Expand Down
10 changes: 10 additions & 0 deletions examples/insert/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ func main() {
}
log.Println("flush completed")

// Now add index
idx, err := entity.NewIndexIvfFlat(entity.L2, 2)
if err != nil {
log.Fatal("fail to create ivf flat index:", err.Error())
}
err = c.CreateIndex(ctx, collectionName, "Vector", idx, false)
if err != nil {
log.Fatal("fail to create index:", err.Error())
}

// load collection with async=false
err = c.LoadCollection(ctx, collectionName, false)
if err != nil {
Expand Down
10 changes: 10 additions & 0 deletions examples/tls/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ func main() {
}
log.Println("flush completed")

// Now add index
idx, err := entity.NewIndexIvfFlat(entity.L2, 2)
if err != nil {
log.Fatal("fail to create ivf flat index:", err.Error())
}
err = c.CreateIndex(ctx, collectionName, "Vector", idx, false)
if err != nil {
log.Fatal("fail to create index:", err.Error())
}

// load collection with async=false
err = c.LoadCollection(ctx, collectionName, false)
if err != nil {
Expand Down

0 comments on commit a6c70a4

Please sign in to comment.