title: Elasticsearch query that is guaranteed to time out
body: <p>Can someone help me craft an Elasticsearch query that is likely to time out on a few thousand records/documents? I would like to see what is actually returned when an aggregation request times out. Is this documented anywhere?</p>
  <p>My attempt so far:</p>
  <pre><code>POST /myindex/_search?size=0
  {
      &quot;aggs&quot; : {
          &quot;total-cost&quot; : {
              &quot;sum&quot; : {
                  &quot;field&quot; : &quot;cost&quot;,
                  &quot;missing&quot;: 1 
              }
          }
      }
  }
  </code></pre>
  <p>The reason for this question is sometimes in production I get a response that's missing the &quot;total-cost&quot; aggregation. I have a hunch it might be due to timeouts. That's why I want to see what is returned exactly when a request times out.</p>
  <p>I've also looked at how to set the request timeout in the Kibana console, and apparently <a href="https://stackoverflow.com/a/47452241/1291717">there is no way</a> to do this.</p>
  <p>NB. I am talking about search timeouts, not connection timeouts.</p>