【发布时间】:2020-07-13 03:57:12
【问题描述】:
我想使用库 Microsoft.Azure.Search 使用文档 ID 删除项目(文档)。我该怎么做?
遵循我到目前为止所尝试的:
public Task DeleteItems(IEnumerable<string> itemsIds)
{
return Task.Run(() =>
{
IndexBatch<string> batch = IndexBatch.Delete<string>(itemsIds);
try
{
//Gets the search service and add the delete batch to be perfomed on the Index
this.GetSearchServiceIndex().Documents.Index(batch);
}
catch (IndexBatchException ex)
{
//Do something in here
}
});
}
【问题讨论】:
标签: c# azure-cognitive-search azure-search-.net-sdk