NewSortedIndex()
This function creates a sorted index configuration for range-based scalar field queries.
func NewSortedIndex() Index
RETURNS:
An index configuration instance. Pass this to CreateIndex() via the index option.
Example
import (
"github.com/milvus-io/milvus/client/v2/index"
"github.com/milvus-io/milvus/client/v2/milvusclient"
)
// Create index configuration
idx := index.NewSortedIndex()
// Use with CreateIndex
createIdxOption := milvusclient.NewCreateIndexOption("collection_name", "vector_field", idx)
task, err := client.CreateIndex(ctx, createIdxOption)