title: Elastic Search FVH highlights the smallest matching token
body: <p>Settings:</p>
  
  <pre><code>{
    "settings": {
      "analysis": {
        "analyzer": {
          "idx_analyzer_ngram": {
            "type": "custom",
            "filter": [
              "lowercase",
              "asciifolding",
              "edgengram_filter_1_32"
            ],
            "tokenizer": "ngram_alltokenchar_tokenizer_1_32"
          },
          "ngrm_srch_analyzer": {
            "filter": [
              "lowercase"
            ],
            "type": "custom",
            "tokenizer": "keyword"
          }
        },
        "tokenizer": {
          "ngram_alltokenchar_tokenizer_1_32": {
            "token_chars": [
              "letter",
              "whitespace",
              "punctuation",
              "symbol",
              "digit"
            ],
            "min_gram": "1",
            "type": "nGram",
            "max_gram": "32"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Mappings:</p>
  
  <pre><code>{
    "properties": {
      "TITLE": {
        "type": "string",
        "fields": {
          "untouched": {
            "index": "not_analyzed",
            "type": "string"
          },
          "ngramanalyzed": {
            "search_analyzer": "ngrm_srch_analyzer",
            "index_analyzer": "idx_analyzer_ngram",
            "type": "string",
            "term_vector": "with_positions_offsets"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>{
    "query": {
      "filtered": {
        "query": {
          "query_string": {
            "query": "have some ha",
            "fields": [
              "TITLE.ngramanalyzed"
            ],
            "default_operator": "and"
          }
        }
      }
    },
    "highlight": {
      "fields": {
        "TITLE.ngramanalyzed": {}
      }
    }
  }
  </code></pre>
  
  <p>I have document indexed with TITLE <strong>have some happy meal</strong>. When I search <strong>have some</strong>, I am able to get proper highlights.</p>
  
  <pre><code>&lt;em&gt;have&lt;/em&gt; &lt;em&gt;some&lt;/em&gt; happy meal
  </code></pre>
  
  <p>As i type more <strong>have some ha</strong>, the highlight results are not as expected. </p>
  
  <pre><code>&lt;em&gt;ha&lt;/em&gt;ve &lt;em&gt;some&lt;/em&gt; &lt;em&gt;ha&lt;/em&gt;ppy meal
  </code></pre>
  
  <p>The <strong>have</strong> word gets partially highlighted as <strong>ha</strong>.</p>
  
  <p>I would expect it to highlight the longest matching token, because with an ngrams with min size = 1, this gives me a highlight of 1 or more char while there should be another matching token of 4 or 5 chars (for example: <strong>have</strong> should also be highlighted along with <strong>ha</strong> being highlighted.</p>
  
  <p>I am not able to find any solution for the same. Please suggest.</p>