title: Cannot delete a document immediately after it is inserted?
body: <p>I've created some tests for my ElasticSearch functionality and I've noticed some strange behavior.  If I have a test that:</p>
  <ol>
  <li>Inserts a document and confirms there are no errors</li>
  <li>Retrieves that same document, confirms there are no errors and confirms it has the expected values</li>
  <li>Deletes the document, confirms there are no errors and confirms 1 document was deleted</li>
  </ol>
  <p>Then the 3rd test will fail because 0 documents were deleted.  If I take one of the following steps:</p>
  <ul>
  <li>Debug the test and put a breakpoint after insert but before delete</li>
  <li>Add <code>time.Sleep(time.Second)</code> immediately before the delete step</li>
  </ul>
  <p>then 1 document is deleted and the 3rd test will pass.  In the cases when the 3rd test has failed, I've gone into my ES instance and confirmed that the document exist.</p>
  <p>This leads me to believe that after inserting a document there is some span of time where <em>something</em> has to happen before I can delete the document.</p>
  <p>My questions is - what needs to happen after insert so that I can delete a document and is there a better way for me to handle this in my tests than sleeping for 1 second?</p>
  <p>I am coding in Golang and I am using the <a href="https://github.com/olivere/elastic" rel="nofollow noreferrer">Olivere ES Client</a></p>