How to generate shingles before synonyms filter?

Hi @mattkallo.

Look this example, maybe help you to find the solution

PUT /test
{
  "settings": {
    "analysis": {
      "analyzer": {
        "synonyms_analyzer": {
          "tokenizer": "standard",
          "filter": [
            "synonyms_filter",
            "shingle_filter"
          ]
        }
      },
      "filter": {
        "synonyms_filter": {
          "type": "synonym",
          "synonyms": [
            "heart attack => cardiac arrest"
          ]
        },
        "shingle_filter": {
          "type": "shingle",
          "min_shingle_size": 2,
          "max_shingle_size": 3,
          "output_unigrams": false
        }
      }
    }
  }
}

GET test/_analyze
{
  "analyzer": "synonyms_analyzer",
  "text": ["heart attack"]
}

Tokens:

{
  "tokens" : [
    {
      "token" : "cardiac arrest",
      "start_offset" : 0,
      "end_offset" : 12,
      "type" : "shingle",
      "position" : 0
    }
  ]
}