title: Azure Search SDK for Blob Storage - Deleting Files
body: <p>I have created an application that lists all the documents in an Azure storage container, and lets the user mark specific files to delete.</p>
  
  <p>This is an Azure Search application, so the process is to add a "deleted" metadata property to the selected files, run the indexer to remove that information from the index, and then physically delete the files.</p>
  
  <p>Here's the code for that process:</p>
  
  <pre><code>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();
  }
  </code></pre>
  
  <p>Everything works fine, but only if I put a breakpoint on the DeleteFlagged() call, effectively forcing a delay between running the indexer and deleting the files.</p>
  
  <p>Without the pause, the indexer comes back as successful, and I delete the files, but the file contents haven't been removed from the index - they still show up in search results (the files have been physically deleted).</p>
  
  <p>Is there something else I need to check before deleting?</p>