Documentation
¶
Index ¶
- Constants
- func NewMeilisearch(logger logger.Logger) vector.Vector
- type Meilisearch
- func (m *Meilisearch) BatchQuery(ctx context.Context, req *vector.BatchQueryRequest) (*vector.BatchQueryResponse, error)
- func (m *Meilisearch) Close() error
- func (m *Meilisearch) CreateCollection(ctx context.Context, req *vector.CreateCollectionRequest) error
- func (m *Meilisearch) Delete(ctx context.Context, req *vector.DeleteRequest) (*vector.DeleteResponse, error)
- func (m *Meilisearch) DeleteCollection(ctx context.Context, req *vector.DeleteCollectionRequest) error
- func (m *Meilisearch) Get(ctx context.Context, req *vector.GetRequest) (*vector.GetResponse, error)
- func (m *Meilisearch) GetCollection(ctx context.Context, req *vector.GetCollectionRequest) (*vector.GetCollectionResponse, error)
- func (m *Meilisearch) GetComponentMetadata() (metadataInfo metadata.MetadataMap)
- func (m *Meilisearch) Init(ctx context.Context, meta vector.Metadata) error
- func (m *Meilisearch) ListCollections(ctx context.Context, req *vector.ListCollectionsRequest) (*vector.ListCollectionsResponse, error)
- func (m *Meilisearch) Query(ctx context.Context, req *vector.QueryRequest) (*vector.QueryResponse, error)
- func (m *Meilisearch) Upsert(ctx context.Context, req *vector.UpsertRequest) (*vector.UpsertResponse, error)
Constants ¶
const ( // DefaultEmbedder is the Meilisearch embedder holding a record's dense // vector. DefaultEmbedder = "default" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Meilisearch ¶
type Meilisearch struct {
// contains filtered or unexported fields
}
Meilisearch implements the Dapr Vector building block with Meilisearch.
Meilisearch stores user-provided embeddings in a document's `_vectors` field, so a vector collection is a Meilisearch index with one `userProvided` embedder. Meilisearch only supports cosine similarity for those embeddings.
func (*Meilisearch) BatchQuery ¶
func (m *Meilisearch) BatchQuery(ctx context.Context, req *vector.BatchQueryRequest) (*vector.BatchQueryResponse, error)
BatchQuery evaluates each query independently against the same collection and returns one result per query in request order. A query that fails validation, is rejected by Meilisearch or names a record that does not exist produces an error result; a request-wide failure (a closed component, a missing collection, invalid credentials, transport, a provider outage) fails the call, whichever query meets it.
func (*Meilisearch) Close ¶
func (m *Meilisearch) Close() error
Close closes the component and stops its shared task-change stream.
func (*Meilisearch) CreateCollection ¶
func (m *Meilisearch) CreateCollection(ctx context.Context, req *vector.CreateCollectionRequest) error
CreateCollection creates a Meilisearch index configured for user-provided embeddings of the requested dimensions. Record metadata is filterable by default; additional Meilisearch settings travel in the request metadata. An existing collection is ALREADY_EXISTS.
func (*Meilisearch) Delete ¶
func (m *Meilisearch) Delete(ctx context.Context, req *vector.DeleteRequest) (*vector.DeleteResponse, error)
Delete deletes records by ID. It is a write: the deletion task is acknowledged with the same mode and wait semantics as Upsert. IDs that do not exist are not an error; a missing collection is NOT_FOUND.
func (*Meilisearch) DeleteCollection ¶
func (m *Meilisearch) DeleteCollection(ctx context.Context, req *vector.DeleteCollectionRequest) error
DeleteCollection deletes a collection. An index that is not configured for vectors is FAILED_PRECONDITION: plain search indexes share the instance, and the vector API must not delete one it reports as not being a collection.
func (*Meilisearch) Get ¶
func (m *Meilisearch) Get(ctx context.Context, req *vector.GetRequest) (*vector.GetResponse, error)
Get fetches records by ID. Found records are returned in request order; records that are not found are omitted.
func (*Meilisearch) GetCollection ¶
func (m *Meilisearch) GetCollection(ctx context.Context, req *vector.GetCollectionRequest) (*vector.GetCollectionResponse, error)
GetCollection returns the record count, dimensions, metric and settings of a collection. An index that is not configured for vectors is FAILED_PRECONDITION.
func (*Meilisearch) GetComponentMetadata ¶
func (m *Meilisearch) GetComponentMetadata() (metadataInfo metadata.MetadataMap)
GetComponentMetadata returns the metadata of the component.
func (*Meilisearch) ListCollections ¶
func (m *Meilisearch) ListCollections(ctx context.Context, req *vector.ListCollectionsRequest) (*vector.ListCollectionsResponse, error)
ListCollections lists the collections of the store: the indexes of the instance that are configured for vectors.
func (*Meilisearch) Query ¶
func (m *Meilisearch) Query(ctx context.Context, req *vector.QueryRequest) (*vector.QueryResponse, error)
Query runs a single nearest-neighbour query.
func (*Meilisearch) Upsert ¶
func (m *Meilisearch) Upsert(ctx context.Context, req *vector.UpsertRequest) (*vector.UpsertResponse, error)
Upsert is a keyed upsert of dense vector records into an existing collection. A missing collection is NOT_FOUND.