GetAsync(Expression<Func<TRecord, bool>>, int, FilteredRecordRetrievalOptions<TRecord>?, CancellationToken)
This method retrieves from the vector store records matching a filter expression. It does not guarantee the existence of the collection.
Declaration
// C#
public async IAsyncEnumerable<TRecord?> GetAsync( Expression<Func<TRecord, bool>> filter, int top, FilteredRecordRetrievalOptions<TRecord>? options = null, CancellationToken cancellationToken = default);Parameter
filterPredicate for filtering the records.
topMaximum number of results to return.
optionsOptional options for retrieving the records.
cancellationTokenThe cancellation token.
Return Value
IAsyncEnumerable<TRecord?> object representing the records matching the provided predicate.
Implements
Microsoft.Extensions.VectorData.VectorStoreCollection
Exceptions
VectorStoreException: The command fails to execute for any reason other than the absence of a record.
Remarks
The filter cannot compare the following unsupported columns types:
BFileBlobClobJsonNClobVectorVector_BinaryVector_Float32Vector_Float64Vector_Int8XmlType