-
|
I have in a partition one magazines new articles per month (about 2000). So should I just have the native container as an other read source??? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
And the same is for UpsertAsync. I get this when i try to insert new document
In production we will have > 3 Million articles, which are split to chunks (on average 5 + the article fully). So 15-20M document Or is my worries unfounded and I should just use id as partitionkey? |
Beta Was this translation helpful? Give feedback.
-
|
And figured it out Model public class Item
{
[VectorStoreData]
[JsonPropertyName("partitionKey")]
public string PartitionKey => $"{Publication}-{PublishedDate:yyyy-MM}";
[JsonPropertyName("id")]
[VectorStoreKey]
public required string Id { get; init; }var database = cosmosClient.GetDatabase(_cosmosOptions.Database);
var cosmosOptions = new CosmosNoSqlCollectionOptions
{
EmbeddingGenerator = embeddingGenerator,
PartitionKeyProperties = new[] { nameof(Item.PartitionKey) }
};
_collection = new CosmosNoSqlCollection<CosmosNoSqlKey, Item>(database, _cosmosOptions.Container, cosmosOptions);Upsert await _collection.UpsertAsync(item, cancellationToken);Read var key = new CosmosNoSqlKey(documentId: id, partitionKey: partitionKey);
return await _collection.GetAsync(key, cancellationToken: cancellationToken); |
Beta Was this translation helpful? Give feedback.
And figured it out
Model
Upsert
Read
var