title: Filter facet terms based on their length when using scripts in Elasticsearch queries
body: <p>I want to create a terms facet which returns results only for terms of length greater than a certain value. Ideally it would look something like:</p>
  
  <pre><code> "facets": {
      "myFacet": {
        "terms": {
          "field": "content",
          "size": 10,
          "script": "term.length &gt; 3 ? true: false"
        }
      }
    }
  </code></pre>
  
  <p>However, the MVEL scripting language doesn't seem to like the term.<strong>length</strong> property. Is there another way to achieve this? The MVEL docs don't provide much info on this use case.</p>