🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
< Docs
  • Go
    • DataImport

BulkImport()

This operation imports the prepared data files to Milvus. To learn how to prepare your data files, read Prepare Source Data.

func BulkImport(ctx context.Context, option *BulkImportOption) (*BulkImportResponse, error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

BulkImportOption

callOpts

Optional parameters for calling the methods.

grpc.CallOption

BulkImportOption

This is a struct type. You can use NewBulkImportOption() to get its concrete implementation.

NewBulkImportOption

The signature of NewBulkImportOption() is as follows:

func NewBulkImportOption(uri string, collectionName string, files [][]string, ) *BulkImportOption

Parameter

Description

Type

uri

The URI of your Milvus instance.

string

collectionName

The name of a collection in the target cluster of this operation.

string

files

The list of string lists, each string list contains a singular row-based file path or multiple column-based file paths.

[][]string

You can chain the following methods to append more parameters to the BulkImportOption struct.

NewCloudBulkImportOption

The signature of NewCloudBulkImportOption() is as follows:

func NewCloudBulkImportOption(uri string, collectionName string, apiKey string, objectURL string, clusterID string, accessKey string, secretKey string, ) *BulkImportOption

Parameter

Description

Type

uri

The endpoint URL of the Zilliz Cloud Data Plane, which should be one of the follows:

  • https://api.cloud.zilliz.com

  • https://api.cloud.zilliz.com.cn

string

collectionName

The name of a collection in the target cluster of this operation.

string

apiKey

A valid Zilliz Cloud API key with sufficient permissions to manipulate the cluster.

string

objectURL

The URL of your data files in one of your block storage buckets. The following are some examples of renowned block storage services:

  • Google Cloud Storage

    gs://\{bucket-name}/\{object-path}/

  • AWS S3

    s3://\{bucket-name}/\{object-path}/

    For details, refer to Storage Options.

string

clusterID

The instance ID of the target cluster of this operation.

You can obtain the instance ID of a cluster from its details page in the Zilliz Cloud console.

string

accessKey

The access key that is used to authenticate access to your data files.

string

secretKey

The secret key that is used to authenticate access to your data files.

string

You can chain the following methods to append more parameters to the BulkImportOption struct.

WithAPIKey

This method appends your Zilliz Cloud API key to the BulkImportOption struct. The signature of the method is as follows:

func (opt *BulkImportOption) WithAPIKey(key string) *BulkImportOption

Parameter

Description

Type

key

A valid Zilliz Cloud API key with sufficient permissions to manipulate the cluster.

string

WithPartition

This method specifies the name of the target partition to the BulkImportOption struct. The signature of the method is as follows:

func (opt *BulkImportOption) WithPartition(partitionName string) *BulkImportOption

Parameter

Description

Type

partitionName

The name of the target partition of this operation.

string

WithOption

This method appends extra options in key-value pairs to the BulkImportOption struct. The signature of the method is as follows:

func (opt *BulkImportOption) WithOption(key, value string) *BulkImportOption

Parameter

Description

Type

key

An extra BulkImportOption key

string

value

The value of the above extra key.

string

grpc.CallOption

This interface provided by the gRPC Go library allows you to specify additional options or configurations when making requests. For possible implementations of this interface, refer to this file.

BulkImportResponse

The BulkImportResponse struct type is as follows:

type BulkImportResponse struct {
    Status  int    `json:"status"`
    Message string `json:"message"`      
    Data struct {
        JobID string `json:"jobId"`
    } `json:"data"`
}

Return

*BulkImportResponse

Example



Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?