title: Elasticsearch Analyzer first 4 and last 4 characters
body: <p>With Elasticsearch, I would like to specify a <strong>search analyzer</strong> where the first 4 characters and last 4 characters are tokenized.</p>
  
  <p><code>For example: supercalifragilisticexpialidocious =&gt; ["supe", "ious"]</code></p>
  
  <p>I have had a go with an ngram as follows </p>
  
  <pre><code>PUT my_index
  {
    "settings": {
      "analysis": {
        "analyzer": {
          "my_analyzer": {
            "tokenizer": "my_tokenizer"
          }
        },
        "tokenizer": {
          "my_tokenizer": {
            "type": "ngram",
            "min_gram": 4,
            "max_gram": 4
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>I am testing the analyzer as follows</p>
  
  <pre><code>POST my_index/_analyze
  {
    "analyzer": "my_analyzer",
    "text": "supercalifragilisticexpialidocious."
  }
  </code></pre>
  
  <p>And get back `super' ... loads of stuff I don't want and 'cious'. The problem for me is <strong>how can I take only the first and last results from the ngram tokenizer specified above?</strong></p>
  
  <pre><code>{
    "tokens": [
      {
        "token": "supe",
        "start_offset": 0,
        "end_offset": 4,
        "type": "word",
        "position": 0
      },
      {
        "token": "uper",
        "start_offset": 1,
        "end_offset": 5,
        "type": "word",
        "position": 1
      },
  ...
      {
        "token": "ciou",
        "start_offset": 29,
        "end_offset": 33,
        "type": "word",
        "position": 29
      },
      {
        "token": "ious",
        "start_offset": 30,
        "end_offset": 34,
        "type": "word",
        "position": 30
      },
      {
        "token": "ous.",
        "start_offset": 31,
        "end_offset": 35,
        "type": "word",
        "position": 31
      }
    ]
  }
  </code></pre>