title: Elasticsearch sort option not supported
body: <p>I'm using elastic search in Rails. I am trying to sort a list of customers by their total dollars spent descending. This is my ruby code:</p>
  
  <pre><code>query = { 
      bool: {
        filter: { 
          term: { store_id: store.id } # Limits customers by current store
        }   
      }   
    }   
  
    sort = { 
      sort: { "total_spent": { order: "desc" }}
    }   
  
    response = Contact.search(query: query, sort: sort)
  </code></pre>
  
  <p>This returns with an error of <code>sort option [total_spent] not supported</code> I've tried with other fields to make sure it wasn't just something wrong with the total_spent field. Thanks.</p>