Поделиться через


AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord> Class

Definition

Service for storing and retrieving vector records, that uses Azure CosmosDB NoSQL as the underlying storage.

public class AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord> : Microsoft.Extensions.VectorData.IKeywordHybridSearch<TRecord>, Microsoft.Extensions.VectorData.IVectorizedSearch<TRecord>, Microsoft.Extensions.VectorData.IVectorStoreRecordCollection<Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL.AzureCosmosDBNoSQLCompositeKey,TRecord>, Microsoft.Extensions.VectorData.IVectorStoreRecordCollection<string,TRecord>
type AzureCosmosDBNoSQLVectorStoreRecordCollection<'Record> = class
    interface IVectorStoreRecordCollection<string, 'Record>
    interface IVectorizedSearch<'Record>
    interface IVectorStoreRecordCollection<AzureCosmosDBNoSQLCompositeKey, 'Record>
    interface IKeywordHybridSearch<'Record>
Public Class AzureCosmosDBNoSQLVectorStoreRecordCollection(Of TRecord)
Implements IKeywordHybridSearch(Of TRecord), IVectorizedSearch(Of TRecord), IVectorStoreRecordCollection(Of AzureCosmosDBNoSQLCompositeKey, TRecord), IVectorStoreRecordCollection(Of String, TRecord)

Type Parameters

TRecord

The data model to use for adding, updating and retrieving data from storage.

Inheritance
AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord>
Implements

Constructors

AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord>(Database, String, AzureCosmosDBNoSQLVectorStoreRecordCollectionOptions<TRecord>)

Initializes a new instance of the AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord> class.

Properties

CollectionName

Gets the name of the collection.

Methods

CollectionExistsAsync(CancellationToken)

Checks if the collection exists in the vector store.

CreateCollectionAsync(CancellationToken)

Creates this collection in the vector store.

CreateCollectionIfNotExistsAsync(CancellationToken)

Creates this collection in the vector store if it doesn't already exist.

DeleteAsync(AzureCosmosDBNoSQLCompositeKey, CancellationToken)

Deletes a record from the vector store. Does not guarantee that the collection exists.

DeleteAsync(String, CancellationToken)

Deletes a record from the vector store. Does not guarantee that the collection exists.

DeleteBatchAsync(IEnumerable<AzureCosmosDBNoSQLCompositeKey>, CancellationToken)

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

DeleteBatchAsync(IEnumerable<String>, CancellationToken)

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

DeleteCollectionAsync(CancellationToken)

Deletes the collection from the vector store.

GetAsync(AzureCosmosDBNoSQLCompositeKey, GetRecordOptions, CancellationToken)

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

GetAsync(String, GetRecordOptions, CancellationToken)

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

GetBatchAsync(IEnumerable<AzureCosmosDBNoSQLCompositeKey>, GetRecordOptions, CancellationToken)

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

GetBatchAsync(IEnumerable<String>, GetRecordOptions, CancellationToken)

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

HybridSearchAsync<TVector>(TVector, ICollection<String>, HybridSearchOptions<TRecord>, CancellationToken)

Performs a hybrid search for records that match the given embedding and keywords, after applying the provided filters.

UpsertAsync(TRecord, CancellationToken)

Upserts a record into the vector store. Does not guarantee that the collection exists. If the record already exists, it is updated. If the record does not exist, it is created.

UpsertBatchAsync(IEnumerable<TRecord>, CancellationToken)

Upserts a group of records into the vector store. Does not guarantee that the collection exists. If the record already exists, it is updated. If the record does not exist, it is created.

VectorizedSearchAsync<TVector>(TVector, VectorSearchOptions<TRecord>, CancellationToken)

Searches the vector store for records that match the given embedding and filter.

Explicit Interface Implementations

IVectorStoreRecordCollection<AzureCosmosDBNoSQLCompositeKey,TRecord>.UpsertAsync(TRecord, CancellationToken)

Upserts a record into the vector store. Does not guarantee that the collection exists. If the record already exists, it is updated. If the record does not exist, it is created.

IVectorStoreRecordCollection<AzureCosmosDBNoSQLCompositeKey,TRecord>.UpsertBatchAsync(IEnumerable<TRecord>, CancellationToken)

Upserts a group of records into the vector store. Does not guarantee that the collection exists. If the record already exists, it is updated. If the record does not exist, it is created.

Applies to