title: elasticsearch (Python/Django) bulk indexing throws No Index error
body: <p>I am using <code>elasticsearch</code>'s python client and <code>elasticsearch-dsl</code> as well. I have created an index <code>IndexName</code> and I validated the existence of the index. I have a doc_type <code>DocumentModelIndex</code> associated with this <code>IndexName</code>.</p>
  
  <pre><code>def bulk_indexing():
          from app.models import DocumentModel
          DocumentModelIndex.init(index=settings.ES_INDEX)
          es = Elasticsearch()
          bulk(client=es,actions=(b.indexing() 
                  for b in DocumentModel.objects.all().iterator()))
  </code></pre>
  
  <p>When I run the above code I get the following error: <code>ValidationException: No index</code>.</p>
  
  <p>I tried Putting a document into that index using:
      curl -XPOST "<a href="http://localhost:9200/index_name/document_model_index/" rel="nofollow noreferrer">http://localhost:9200/index_name/document_model_index/</a>" -d "{\"source\":\"google\"}"
  and this worked.</p>
  
  <p>I am new to <code>elasticsearch</code> and am not able to figure this out. Any help would be much appreciated!</p>