Table of Contents

Method GetAsync

Namespace
Qavren.Edge.VectorData
Assembly
Qavren.Edge.VectorData.dll

GetAsync(TKey, RecordRetrievalOptions?, CancellationToken)

Gets a record from the vector store. Does not guarantee that the collection exists. Returns null if the record is not found.

public override Task<TRecord?> GetAsync(TKey key, RecordRetrievalOptions? options = null, CancellationToken cancellationToken = default)

Parameters

key TKey

The unique ID associated with the record to get.

options RecordRetrievalOptions

Optional options for retrieving the record.

cancellationToken CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

Task<TRecord>

The record if found, otherwise null.

Exceptions

VectorStoreException

The command fails to execute for any reason.

GetAsync(IEnumerable<TKey>, RecordRetrievalOptions?, CancellationToken)

Gets a batch of records from the vector store. Does not guarantee that the collection exists.

public override IAsyncEnumerable<TRecord> GetAsync(IEnumerable<TKey> keys, RecordRetrievalOptions? options = null, CancellationToken cancellationToken = default)

Parameters

keys IEnumerable<TKey>

The unique IDs associated with the record to get.

options RecordRetrievalOptions

Optional options for retrieving the records.

cancellationToken CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

IAsyncEnumerable<TRecord>

The records associated with the specified unique keys.

Remarks

The exact method of retrieval is implementation-specific and can vary based on database support. The default implementation of this method retrieves the records one after the other, but implementations which supporting batching can override to provide a more efficient implementation.

Only found records are returned, so the result set might be smaller than the requested keys.

This method throws for any issues other than records not being found.

Exceptions

VectorStoreException

The command fails to execute for any reason.

GetAsync(Expression<Func<TRecord, bool>>, int, FilteredRecordRetrievalOptions<TRecord>?, CancellationToken)

Gets matching records from the vector store. Does not guarantee that the collection exists.

public override IAsyncEnumerable<TRecord> GetAsync(Expression<Func<TRecord, bool>> filter, int top, FilteredRecordRetrievalOptions<TRecord>? options = null, CancellationToken cancellationToken = default)

Parameters

filter Expression<Func<TRecord, bool>>

The predicate to filter the records.

top int

The maximum number of results to return.

options FilteredRecordRetrievalOptions<TRecord>

Options for retrieving the records.

cancellationToken CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

IAsyncEnumerable<TRecord>

The records that match the given predicate.

Exceptions

VectorStoreException

The command fails to execute for any reason.