Elasticsearch - how to make shorter phrase more relevant in result

This post has a good solution: instead of using the edge_ngram filter, use the edge_ngram tokenizer:

  "settings": {
    "index": {
      "refresh_interval": "1m",
      "number_of_shards": "1",
      "number_of_replicas": "1",
      "analysis": {
        "tokenizer": {
          "autocomplete_tokenizer": {
            "type": "edge_ngram",
            "min_gram": "1",
            "max_gram": "20"
          }
        },
        "analyzer": {
          "autocomplete": {
            "filter": [
              "lowercase",
              "asciifolding"
            ],
            "type": "custom",
            "tokenizer": "autocomplete_tokenizer"
          },
          "default": {
            "filter": [
              "lowercase",
              "asciifolding"
            ],
            "type": "custom",
            "tokenizer": "standard"
          }
        }
      }
    }
  }