title: ElasticSearch async delete? 200 just after deleting index in Rails app
body: <p>We're using ElasticSearch with the Tire gem on a Rails app. For our integration tests, we delete and recreate the index before each example, something along the lines of</p>
  
  <pre><code>Foo.index.delete
  Foo.create_elasticsearch_index
  </code></pre>
  
  <p>Where <code>Foo</code> includes <code>Tire::Model::Persistence</code>. But we started having missing index errors from time to time when running our test suite on CI. I went ahead and enabled debugging and then I found the following in the logs:</p>
  
  <pre><code># 2013-10-04 09:25:05:839 [DELETE] ("test_index")
  #
  curl -X DELETE http://some-server:9200/test_index
  
  # 2013-10-04 09:25:05:840 [200]
  #
  # {
  #   "ok": true,
  #   "acknowledged": true
  # }
  
  # 2013-10-04 09:25:05:852 [HEAD] ("test_index")
  #
  curl -I "http://some-server:9200/test_index"
  
  # 2013-10-04 09:25:05:852 [200]
  </code></pre>
  
  <p>As you can see, I get a 200 ok response for the DELETE request, but then when Tire does a HEAD request to see if the index exists before creating it, it still returns a 200 instead of a 404. This happens randomly, most of the times it works ok, but at some point in the test suite it will fail.</p>
  
  <p>I tried waiting for a yellow status between the delete and the create operations, but it didn't work. So my question here would be, is the delete index operation asynchronous in some way? (Couldn't find anything on the ES doc about that). Is there any way to wait for the index to be deleted? (Since the yellow status doesn't work).</p>
  
  <p>Edit: Thanks @PinnyM for the clarification. So all the operations through the HTTP API <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html" rel="nofollow">are indeed asynchronous</a>. So the question that remains is, how can I wait for the index to be deleted so I can create it again?</p>