milvus

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S

type S struct {
	// contains filtered or unexported fields
}

S wraps Milvus client.

func New

func New(ctx context.Context, cfg db.Config, log logr.Logger) (*S, error)

New creates an active client connection to the Milvus server.

func (*S) CreateVectorStore

func (s *S) CreateVectorStore(ctx context.Context, name string, dimensions int) (int64, error)

CreateVectorStore creates a new collection in milvus.

func (*S) DeleteDocuments

func (s *S) DeleteDocuments(ctx context.Context, collectionName, fileID string) error

DeleteDocuments deletes documents from a collection in milvus by fileID.

func (*S) DeleteVectorStore

func (s *S) DeleteVectorStore(ctx context.Context, name string) error

DeleteVectorStore deletes a collection in milvus.

func (*S) InsertDocuments

func (s *S) InsertDocuments(ctx context.Context, name string, files, texts []string, vectors [][]float32) error

InsertDocuments inserts documents into a collection in milvus.

func (*S) ListVectorStores

func (s *S) ListVectorStores(ctx context.Context) ([]int64, error)

ListVectorStores lists collections in milvus.

func (*S) Search

func (s *S) Search(ctx context.Context, collectionName string, vectors []float32, numDocuments int) ([]string, error)

Search searches for the documents with similar vectors in milvus. The texts of the matched documents are returned.

func (*S) UpdateVectorStoreName

func (s *S) UpdateVectorStoreName(ctx context.Context, oldName, newName string) error

UpdateVectorStoreName updates a collection name in milvus.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL