1
我已经创建了一个列出的Azure存储容器中的所有文件,并让用户标记特定的文件删除的应用程序。Azure的搜索SDK的Blob存储 - 删除文件
这是一个Azure的搜索应用程序,所以这个过程是一个“已删除”元数据属性添加到选定的文件,运行索引器从索引中删除该信息,然后再物理删除这些文件。
下面是该进程的代码:
serviceClient.Indexers.Run(documentIndexer);
var status = serviceClient.Indexers.GetStatus(documentIndexer).LastResult.Status;
// Loop until the indexer is done
while (status == IndexerExecutionStatus.InProgress)
{
status = serviceClient.Indexers.GetStatus(documentIndexer).LastResult.Status;
}
// If successful, delete the flagged files
if (status == IndexerExecutionStatus.Success)
{
DeleteFlagged();
}
一切工作正常,但只有当我把一个断点上DeleteFlagged()调用,有效地迫使运行索引和删除文件之间的延迟。
没有暂停,索引器恢复成功,我删除文件,但文件内容没有从索引中删除 - 它们仍然显示在搜索结果中(文件已被物理删除)。
有没有别的东西,我需要在删除前检查?
感谢尤金,这是有道理的。 – PhillipXT