NewRTreeIndex()

This function creates an R-tree index configuration for spatial data queries on geometry fields.

func NewRTreeIndex() Index

RETURNS:

Index

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.NewRTreeIndex()

// Use with CreateIndex
createIdxOption := milvusclient.NewCreateIndexOption("collection_name", "vector_field", idx)
task, err := client.CreateIndex(ctx, createIdxOption)

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?