title: Single query to find document with largest value for some field
body: <p>I've got a collection of documents that have unique numeric run ids, and I want to find the document with the highest run id.</p>
  
  <p>I can do that two queries.</p>
  
  <p>Firstly, I can find the highest run id:</p>
  
  <pre><code>{
      "size": 0,
      "aggregations": {
        "latest_run_id": {
          "aggregations": {
            "latest_run_id": {
              "max": {"field": "run_id"}
            }
          }
        }
      }
  }
  </code></pre>
  
  <p>Secondly, I can find the document with that run id:</p>
  
  <pre><code>{
      "filter": {
          {"term": {"run_id": latest_run_id}}
      }
  }
  </code></pre>
  
  <p>Is there a way I can do this with a single query?</p>