Я хочу удалить элемент (документ), используя идентификатор документа, используя библиотеку Microsoft.Azure.Search
. Как я могу это сделать?
Следует тому, что я пробовал до сих пор:
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
}
});
}