title: How to fine-tune match_all queries?
body: <p>The following query yields results:</p>
  
  <pre><code>GET /sentinel/pingback/_search
  {
        "match_all": {}
  }
  </code></pre>
  
  <p>I wanted to fine-tune the <code>query</code> to add a time range</p>
  
  <pre><code>GET /sentinel/pingback/_search
  {
     "query": {
        "range": {
           "time": {
              "gte": "now-20m"
           }
        },
        "match_all": {}
     }
  }
  </code></pre>
  
  <p>This does not work anymore, the error is</p>
  
  <pre><code>"error": {
        "root_cause": [
           {
              "type": "parse_exception",
              "reason": "failed to parse search source. expected field name but got [START_OBJECT]"
           }
        ],
  (...)
  </code></pre>
  
  <p>The time range, however, correctly works when on its own</p>
  
  <pre><code>GET /sentinel/pingback/_search
  {
     "query": {
        "range": {
           "time": {
              "gte": "now-20m"
           }
        }
     }
  }
  </code></pre>
  
  <p>I was therefore expecting that for one <code>query</code> I could add independent "fine-tuning" components (like <code>range</code>for instance) but apparently it does not work this way.</p>
  
  <p><strong>How to combine these query constraints?</strong></p>
  
  <p>Note: I know that I can get rid of <code>match_all</code> in the query above. I want to keep it because it will either be a <code>match_all</code> or a <code>match</code> (which is another constraint I was wishing to add to the all-encompassing <code>query</code></p>