title: Term aggregation consider only the prefix to aggregate
body: <p>In my elastic search documents I have users and some sort of representation of his place in the organization, for instance:
  The CEO is position 1
  The ones directly under the CEO will be 1/1, 1/2, 1/3, and so on
  The ones under 1/1 will be 1/1/1, 1/1/2, 1/2/3, etc</p>
  
  <p>I have an aggregration in which I want to aggregate by VP, so I want everybody under 1/1, 1/2, 1/3.</p>
  
  <p>To do that I created a query like this one:</p>
  
  <pre><code>"aggs": {
              "information": {
                  "terms":{
                      "field": "position",
                      "script": "_value.replaceAll('(1/1/[0/]*[1-9]).+', '$1')"
                  } 
  </code></pre>
  
  <p>This would get the prefix and replace by the group in the regex, so everyone would have the same position, then I could make the aggregation. This has a poor performance.</p>
  
  <p>I was thinking about using something like this</p>
  
  <pre><code>"aggs": {
              "information": {
                  "terms":{
                      "field": "position",
                      "prefix": "1/1/.*'
                  } 
  </code></pre>
  
  <p>So I would group by everyone that starts with 1/1 (1/1/1/1, 1/1/1/2, 1/1/1/3 would be one group, 1/1/2/1, 1/1/2/2, 1/1/2/3  would be a second group and so on).</p>
  
  <p>Is it possible?</p>