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