title: MongoDB Atlas Search - slow count of matched documents
body: <p>I have a collection with 11M records, which contains among other properties, a &quot;Name&quot; property with a client name:</p>
  <pre><code>{
      &quot;Name&quot; : &quot;Teressa Bella&quot;
  }
  </code></pre>
  <p>I have created an Atlas Search index on the &quot;Name&quot; field with the following definition:</p>
  <pre><code>{
    &quot;mappings&quot;: {
      &quot;dynamic&quot;: false,
      &quot;fields&quot;: {
        &quot;Name&quot;: {
          &quot;analyzer&quot;: &quot;lucene.standard&quot;,
          &quot;type&quot;: &quot;string&quot;
        }
      }
    }
  }
  </code></pre>
  <p>My use case counting all the documents that match a certain term which I'm doing like so:</p>
  <pre><code>db.getCollection('recipients').aggregate([
    {
      $search: {
        &quot;text&quot;: {
          &quot;query&quot;: &quot;Teressa&quot;,
          &quot;path&quot;: &quot;Name&quot;
        }
      }
    },
    {
      $count: &quot;total&quot;
    }
  ])
  </code></pre>
  <p>The problem is that this query takes about 40s to complete on an M30 Atlas cluster (sometimes 10s or 20s if entirely fetched from memory, I presume).
  Is this within the expected execution time for matching a term on 11M documents?
  I would appreciate any suggestions on how i can optimize this kind of query.</p>