title: How to include `search_type=count` in a query?
body: <p>I have a Python script that runs many ElasticSearch aggregations, e.g.: </p>
  
  <pre><code>client = Elasticsearch(...)
  q =  {"aggs": {"my_name":{"terms": "field", "fieldname"}}}
  res = client.search(index = "indexname*", doc_type = "doc_type", body = q)
  </code></pre>
  
  <p>But this returns the search query (match everything I think) <code>res["hits"]</code> and the aggregation results <code>res["aggregations"]</code>. </p>
  
  <p>What I want to run is the Python equivalent of the following</p>
  
  <pre><code>GET /index*/doc_type/_search?search_type=count
  
  {"aggs": {"my_name":{"terms": "field", "fieldname"}}}
  </code></pre>
  
  <p>How do I make sure to include the <code>?search_type=count</code> when using Python Elasticsearch? </p>
  
  <p>I'd like to know this in general, but the current reason I'm looking into this is I occasionally get errors caused by timeouts or data size when running the queries. My suspicion is that if I can only ask for the counting then I'll avoid these. </p>