title: Elasticsearch- highlighting on both ".keyword" and text fields
body: <p>I am finding issues with highlighting when searching on fields using its complete data.I have used custom analyzers and each field is stored as text and keyword.</p>
  
  <p>I am using whitespace as search analyzer.</p>
  
  <p>My custom analyzer is:</p>
  
  <pre><code>"analysis": {
    "filter": {
      "indexFilter": {
        "type": "pattern_capture",
        "preserve_original": "true",
        "patterns": [
          "([@,$,%,&amp;,!,.,#,^,*]+)",
          "([\\w,.]+)",
          "([\\w,@]+)",
          "([-]+)",
          "(\\w+)"
        ]
      }
    },
    "analyzer": {
      "indexAnalyzer": {
        "filter": [
          "indexFilter",
          "lowercase"
        ],
        "tokenizer": "whitespace"
      },
      "searchAnalyzer": {
        "filter": [
          "lowercase"
        ],
      "tokenizer": "whitespace"
    }
  }
  </code></pre>
  
  <p>My mapping file is :</p>
  
  <pre><code>"field": {
    "type": "text",
    "term_vector": "with_positions_offsets",
    "fields": {
      "keyword": {
        "type": "keyword",
        "ignore_above": 256
      }
    },
    "analyzer": "indexAnalyzer",
    "search_analyzer": "searchAnalyzer"
  }
  </code></pre>
  
  <p>My query is :</p>
  
  <pre><code>{
    "from": 0,
    "size": 24,
    "query": {
      "bool": {
        "should": [
          {
            "multi_match": {
              "query": "monkey business",
              "type": "phrase",
              "slop": "2",
              "fields": []
            }
          }
        ],
        "minimum_should_match": 1
      }
    },
    "highlight": {
      "type": "unified",
      "fields": {
        "*": {}
      }
    }
  }
  </code></pre>
  
  <p>my highlight results are : </p>
  
  <pre><code>"highlight": {
    "field.keyword": [
      "&lt;em&gt;monkey business&lt;/em&gt;"
    ],
    "field": [
      "&lt;em&gt;monkey&lt;/em&gt; &lt;em&gt;business&lt;/em&gt;"
    ]
  }
  </code></pre>