title: Elasticsearch NEST Document count for default index
body: <p>I am using NEST for Elasticsearch 6 and would like to get the number of documents for the default index.</p>
  
  <p>The <a href="https://www.elastic.co/guide/en/elasticsearch/client/net-api/1.x/count.html" rel="nofollow noreferrer">documentation</a> refers to the 1.1 version of the API which no longer seems to work.</p>
  
  <p>I have created the connection settings using a default index:</p>
  
  <pre><code>var connectionSettings = new ConnectionSettings().DefaultIndex("test_docs");
  </code></pre>
  
  <p>When I try the code from the 1.1 api documentation:</p>
  
  <pre><code>var result = client.Count();
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>The type arguments for method
    'ElasticClient.Count(Func, ICountRequest>)'
    cannot be inferred from the usage. Try specifying the type arguments
    explicitly.</p>
  </blockquote>
  
  <p>When I supply a type it is appended to the path.  For example:</p>
  
  <pre><code>client.Count&lt;TestDocument&gt;();
  </code></pre>
  
  <p>Generates a URL of <a href="http://localhost:9200/test_docs/testdocument/_count" rel="nofollow noreferrer">http://localhost:9200/test_docs/testdocument/_count</a> when what I really need is <a href="http://localhost:9200/test_docs/_count" rel="nofollow noreferrer">http://localhost:9200/test_docs/_count</a></p>