client/v2.6.2
Release Notes - Milvus Go SDK v2.6.2
Summary
This release introduces QueryIterator support for efficient large result set iteration and adds Struct Array field type support in the Go SDK.
New Features
QueryIterator Support
Added QueryIterator for efficiently iterating over large query result sets using PK-based pagination (#46633).
- Support for Int64 and VarChar primary key types for automatic pagination
- Configurable options via QueryIteratorOption:
- WithBatchSize(int) - Set batch size for each iteration (default: 1000)
- WithIteratorLimit(int64) - Set overall limit of entries to iterate
- WithFilter(string) - Set filter expression
- WithOutputFields(...string) - Specify output fields
- WithPartitions(...string) - Specify partition names
- WithConsistencyLevel(ConsistencyLevel) - Set consistency level
Usage Example:
opt := milvusclient.NewQueryIteratorOption("collection_name").
WithBatchSize(500).
WithFilter("age > 18").
WithOutputFields("id", "name", "vector")
iter, err := client.QueryIterator(ctx, opt)
for {
rs, err := iter.Next(ctx)
if errors.Is(err, io.EOF) {
break
}
// process rs...
}