title: How to highlight ngram tokens in a word using elastic search
body: <p>I would like to highlight just the ngrams which match, not the whole word.
  Example:</p>
  
  <pre><code>term: "Wo"
  highlight should be: "&lt;em&gt;Wo&lt;/em&gt;nderfull world!"
  currently it is: "&lt;em&gt;Wonderfull&lt;/em&gt; world!"
  </code></pre>
  
  <p>Mapping is:</p>
  
  <pre><code>{
    "global_search_1495732922733" : {
      "mappings" : {
        "meeting" : {
          "properties" : {
          ...
            "name" : {
              "type" : "text",
              "analyzer" : "meeteor_index_analyzer",
              "search_analyzer" : "meeteor_search_term_analyzer"
            },
            ...
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Analyzers are:</p>
  
  <pre><code>"analysis" : {
    "filter" : {
      "meeteor_stemmer" : {
        "name" : "english",
        "type" : "stemmer"
      },
      "meeteor_ngram" : {
        "type" : "nGram",
        "min_gram" : "2",
        "max_gram" : "15"
      }
    },
    "analyzer" : {
      "meeteor_search_term_analyzer" : {
        "filter" : [
          "lowercase",
          "asciifolding"
        ],
        "tokenizer" : "standard"
      },
      "meeteor_index_analyzer" : {
        "filter" : [
          "lowercase",
          "asciifolding",
          "meeteor_ngram"
        ],
        "tokenizer" : "standard"
      },
      "meeteor_project_id_analyzer" : {
        "tokenizer" : "standard"
      }
    }
  },
  </code></pre>
  
  <p>Concrete example:</p>
  
  <pre><code>curl -XGET 'localhost:9200/global_search/meeting/_search?pretty' -H 'Content-Type: application/json' -d'
  {
      "query": {
          "match": {
              "name": "Me"
          }
      },
      "highlight":{
        "fields": {
          "name": {}
        }
      }
  }
  '
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code> "...highlight" : {
            "name" : [
              "Sad &lt;em&gt;Meeting&lt;/em&gt;"
            ]
          }
  </code></pre>