title: Sort documents by size of a field
body: <p>I have documents like below indexed,</p>
  
  <p>1.</p>
  
  <pre><code> {
  "name": "Gilly",
  "hobbyName" : "coin collection",
  "countries": ["US","France","Georgia"]
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code> {
  "name": "Billy",
  "hobbyName":"coin collection",
  "countries":["UK","Ghana","China","France"]
  }
  </code></pre>
  
  <p>Now I need to sort these documents based on the array length of the field "countries", such that the result after the sorting would be of the order document2,document1. How can I achieve this using elasticsearch?</p>