Class VolatileVectorStoreRecordCollection<Record>
- java.lang.Object
-
- com.microsoft.semantickernel.data.VolatileVectorStoreRecordCollection<Record>
-
- Type Parameters:
Record- The type of record in the collection.
- All Implemented Interfaces:
VectorizedSearch<Record>,VectorStoreRecordCollection<String,Record>
public class VolatileVectorStoreRecordCollection<Record> extends Object implements VectorStoreRecordCollection<String,Record>
Represents a volatile vector store record collection.
-
-
Constructor Summary
Constructors Constructor Description VolatileVectorStoreRecordCollection(String collectionName, VolatileVectorStoreRecordCollectionOptions<Record> options)Creates a new instance of the volatile vector store record collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Boolean>collectionExistsAsync()Checks if the collection exists in the store.reactor.core.publisher.Mono<VectorStoreRecordCollection<String,Record>>createCollectionAsync()Creates the collection in the store.reactor.core.publisher.Mono<VectorStoreRecordCollection<String,Record>>createCollectionIfNotExistsAsync()Creates the collection in the store if it does not exist.reactor.core.publisher.Mono<Void>deleteAsync(String key, DeleteRecordOptions options)Deletes a record from the store.reactor.core.publisher.Mono<Void>deleteBatchAsync(List<String> strings, DeleteRecordOptions options)Deletes a batch of records from the store.reactor.core.publisher.Mono<Void>deleteCollectionAsync()Deletes the collection from the store.reactor.core.publisher.Mono<Record>getAsync(String key, GetRecordOptions options)Gets a record from the store.reactor.core.publisher.Mono<List<Record>>getBatchAsync(List<String> keys, GetRecordOptions options)Gets a batch of records from the store.StringgetCollectionName()Gets the name of the collection.reactor.core.publisher.Mono<VectorSearchResults<Record>>searchAsync(List<Float> vector, VectorSearchOptions options)Vectorized search.reactor.core.publisher.Mono<String>upsertAsync(Record data, UpsertRecordOptions options)Inserts or updates a record in the store.reactor.core.publisher.Mono<List<String>>upsertBatchAsync(List<Record> data, UpsertRecordOptions options)Inserts or updates a batch of records in the store.
-
-
-
Constructor Detail
-
VolatileVectorStoreRecordCollection
public VolatileVectorStoreRecordCollection(String collectionName, VolatileVectorStoreRecordCollectionOptions<Record> options)
Creates a new instance of the volatile vector store record collection.- Parameters:
collectionName- The name of the collection.options- The options for the collection.
-
-
Method Detail
-
getCollectionName
public String getCollectionName()
Gets the name of the collection.- Specified by:
getCollectionNamein interfaceVectorStoreRecordCollection<String,Record>- Returns:
- The name of the collection.
-
collectionExistsAsync
public reactor.core.publisher.Mono<Boolean> collectionExistsAsync()
Checks if the collection exists in the store.- Specified by:
collectionExistsAsyncin interfaceVectorStoreRecordCollection<String,Record>- Returns:
- A Mono emitting a boolean indicating if the collection exists.
-
createCollectionAsync
public reactor.core.publisher.Mono<VectorStoreRecordCollection<String,Record>> createCollectionAsync()
Creates the collection in the store.- Specified by:
createCollectionAsyncin interfaceVectorStoreRecordCollection<String,Record>- Returns:
- A Mono representing the completion of the creation operation.
-
createCollectionIfNotExistsAsync
public reactor.core.publisher.Mono<VectorStoreRecordCollection<String,Record>> createCollectionIfNotExistsAsync()
Creates the collection in the store if it does not exist.- Specified by:
createCollectionIfNotExistsAsyncin interfaceVectorStoreRecordCollection<String,Record>- Returns:
- A Mono representing the completion of the creation operation.
-
deleteCollectionAsync
public reactor.core.publisher.Mono<Void> deleteCollectionAsync()
Deletes the collection from the store.- Specified by:
deleteCollectionAsyncin interfaceVectorStoreRecordCollection<String,Record>- Returns:
- A Mono representing the completion of the deletion operation.
-
getAsync
public reactor.core.publisher.Mono<Record> getAsync(String key, GetRecordOptions options)
Gets a record from the store.- Specified by:
getAsyncin interfaceVectorStoreRecordCollection<String,Record>- Parameters:
key- The key of the record to get.options- The options for getting the record.- Returns:
- A Mono emitting the record.
-
getBatchAsync
public reactor.core.publisher.Mono<List<Record>> getBatchAsync(List<String> keys, GetRecordOptions options)
Gets a batch of records from the store.- Specified by:
getBatchAsyncin interfaceVectorStoreRecordCollection<String,Record>- Parameters:
keys- The keys of the records to get.options- The options for getting the records.- Returns:
- A Mono emitting a list of records.
-
upsertAsync
public reactor.core.publisher.Mono<String> upsertAsync(Record data, UpsertRecordOptions options)
Inserts or updates a record in the store.- Specified by:
upsertAsyncin interfaceVectorStoreRecordCollection<String,Record>- Parameters:
data- The record to upsert.options- The options for upserting the record.- Returns:
- A Mono emitting the key of the upserted record.
-
upsertBatchAsync
public reactor.core.publisher.Mono<List<String>> upsertBatchAsync(List<Record> data, UpsertRecordOptions options)
Inserts or updates a batch of records in the store.- Specified by:
upsertBatchAsyncin interfaceVectorStoreRecordCollection<String,Record>- Parameters:
data- The records to upsert.options- The options for upserting the records.- Returns:
- A Mono emitting a list of keys of the upserted records.
-
deleteAsync
public reactor.core.publisher.Mono<Void> deleteAsync(String key, DeleteRecordOptions options)
Deletes a record from the store.- Specified by:
deleteAsyncin interfaceVectorStoreRecordCollection<String,Record>- Parameters:
key- The key of the record to delete.options- The options for deleting the record.- Returns:
- A Mono representing the completion of the deletion operation.
-
deleteBatchAsync
public reactor.core.publisher.Mono<Void> deleteBatchAsync(List<String> strings, DeleteRecordOptions options)
Deletes a batch of records from the store.- Specified by:
deleteBatchAsyncin interfaceVectorStoreRecordCollection<String,Record>- Parameters:
strings- The keys of the records to delete.options- The options for deleting the records.- Returns:
- A Mono representing the completion of the deletion operation.
-
searchAsync
public reactor.core.publisher.Mono<VectorSearchResults<Record>> searchAsync(List<Float> vector, VectorSearchOptions options)
Vectorized search. This method searches for records that are similar to the given vector.- Specified by:
searchAsyncin interfaceVectorizedSearch<Record>- Parameters:
vector- The vector to search with.options- The options to use for the search.- Returns:
- A list of search results.
-
-