title: Elastic search count query
body: <p>I am trying to find occurences of a specific pattern within a given period of time.
  I don't get the count for that pattern with <code>Query 1</code> which has time parameter, but works with <code>Query 2</code>.
  Can you please if there is any issue with <code>Query 1</code>.</p>
  <h3>Query 1:</h3>
  <pre><code>GET/_count?pretty{
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: {
          &quot;query_string&quot;: {
            &quot;query&quot;: &quot;Stopping PSB: start the yum-updateonboot deamon...&quot;
          }
        },
        &quot;filter&quot;: {
          &quot;range&quot;: {
            &quot;@timestamp&quot;: {
              &quot;gt&quot;: &quot;now-1d&quot;
            }
          }
        }
      }
    }
  }'  Result: {   **&quot;count&quot; : 0,**   &quot;_shards&quot; : {     &quot;total&quot; : 2287,     &quot;successful&quot; : 2287,     &quot;skipped&quot; : 0,     &quot;failed&quot; : 0   } 
  </code></pre>
  Query 2:
  <pre><code>GET/_count?pretty{
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: {
          &quot;query_string&quot;: {
            &quot;query&quot;: &quot;Stopping PSB: start the yum-updateonboot deamon...&quot;
          }
        }
      }
    }
  }Result: {
    &quot;count&quot;: 280483,
    &quot;_shards&quot;: {
      &quot;total&quot;: 2287,
      &quot;successful&quot;: 2287,
      &quot;skipped&quot;: 0,
      &quot;failed&quot;: 0
    }
  </code></pre>