title: ElasticSearch - Statistical facet on length of string field
body: <p>I would like to retrieve data about a string field like the min, max and average length (by counting the number of characters inside the string). My issue is that <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-min-aggregation.html" rel="nofollow">aggregations</a> can only be used for numeric fields. Besides, I tried it using a simple statistical facet,</p>
  
  <pre><code> "query":{
        "match_all": {}
    }, 
   "facets":{
        "stat1":{
             "statistical":{
                 "field":"title"}
                 }
            } 
  </code></pre>
  
  <p>but I get shard failures and SearchPhaseExecutionException. When trying with a script field the error returned is an OutOfMemoryError:</p>
  
  <pre><code>  "query":{
         "match_all": {}
     }, 
    "script_fields":{
         "test1":{"script": "doc[\"title\"].value" }
     }
  </code></pre>
  
  <p>Is it possible to retrive such data about a simple "title" string field using CURL? Thank you!</p>