Documentation ¶
Index ¶
- Variables
- type Option
- func WithCollectionName(name string) Option
- func WithConsistencyLevel(level entity.ConsistencyLevel) Option
- func WithDropOld() Option
- func WithEF(ef int) Option
- func WithEmbedder(embedder embeddings.Embedder) Option
- func WithIndex(idx entity.Index) Option
- func WithMaxTextLength(num int) Option
- func WithMetaField(str string) Option
- func WithPartitionName(name string) Option
- func WithPrimaryField(str string) Option
- func WithSearchParameters(sp entity.SearchParam) Option
- func WithShards(num int32) Option
- func WithTextField(str string) Option
- func WithVectorField(str string) Option
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmbedderWrongNumberVectors = errors.New( "number of vectors from embedder does not match number of documents", ) ErrColumnNotFound = errors.New("invalid field") )
var ErrInvalidOptions = errors.New("invalid options")
ErrInvalidOptions is returned when the options given are invalid.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(p *Store)
Option is a function type that can be used to modify the client.
func WithCollectionName ¶
WithCollectionName sets the collection for the milvus store.
func WithConsistencyLevel ¶
func WithConsistencyLevel(level entity.ConsistencyLevel) Option
WithConsistencyLevel sets the consistency level for seaarch.
func WithDropOld ¶
func WithDropOld() Option
WithDropOld store will drop and recreate collection on initialization.
func WithEmbedder ¶
func WithEmbedder(embedder embeddings.Embedder) Option
WithEmbedder sets the embedder to use.
func WithMaxTextLength ¶
WithMaxTextLength sets the maximum length of the text field in the collection.
func WithMetaField ¶
WithMetaField sets te name of the meta field in the collection schema.
func WithPartitionName ¶
WithPartitionName sets the milvus partition for the collection.
func WithPrimaryField ¶
WithPrimaryField name of the primary field in the collection.
func WithSearchParameters ¶
func WithSearchParameters(sp entity.SearchParam) Option
WithSearchParameters sets the search parameters.
func WithShards ¶
WithShards number of shards to create for a collection.
func WithTextField ¶
WithTextField sets the name of the text field in the collection schema.
func WithVectorField ¶
WithVectorField sets the name of the vector field in the collection.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a wrapper around the milvus client.
func New ¶
New creates an active client connection to the (specified, or default) collection in the Milvus server and returns the `Store` object needed by the other accessors.
func (Store) AddDocuments ¶
func (s Store) AddDocuments(ctx context.Context, docs []schema.Document, _ ...vectorstores.Option, ) error
AddDocuments adds the text and metadata from the documents to the Milvus collection associated with 'Store'.