title: Counting number of documents in an index in elasticsearch
body: <p>I'm doing a bulk operation to index 100 documents at once using the python ElasticSearch Client. I want to count the total number of documents in an index. So I do the bulk op and then count the number of documents in an index as below:</p>
  
  <pre><code>helpers.bulk(es_client, actions);
  es_client.count('index').get('count')
  </code></pre>
  
  <p>However the second line still returns the old count, and I tried to run the second line from a different file, which returns the correct result. I suspect that bulk op is not yet completed. Please correct me if I'm wrong, and what would be the workaround to do what I want?</p>