title: Is there a performance difference between `ngram` filter and `ngram` tokenizer in Elasticsearch
body: <p>I have tried both and they seem to produce the same results when I test the analyzers</p>
  
  <pre><code>settings: {
      analysis: {
          filter: {
              ngram_filter: {
                  type: "ngram",
                  min_gram: 2,
                  max_gram: 20
              }
          },
          tokenizer: {
              ngram_tokenizer: {
                  type: "ngram",
                  min_gram: 2,
                  max_gram: 20
              }
          },
          analyzer: {
              index_ngram: {
                  type: "custom",
                  tokenizer: "keyword",
                  filter: [ "ngram_filter", "lowercase" ]
              },
              index_ngram2: {
                  type: "custom",
                  tokenizer: "ngram_tokenizer",
                  filter: [ "lowercase" ]
              },
          },
      }
  }
  </code></pre>
  
  <p>I get the same results doing:</p>
  
  <pre><code>curl -X GET "localhost:9200/my_index/_analyze?pretty" -H 'Content-Type: application/json' -d'
  {
    "analyzer": "index_ngram", 
    "text":     "P&amp;G 40-Bh"
  }
  '
  </code></pre>
  
  <p>and</p>
  
  <pre><code>curl -X GET "localhost:9200/my_index/_analyze?pretty" -H 'Content-Type: application/json' -d'
  {
    "analyzer": "index_ngram2", 
    "text":     "P&amp;G 40-Bh"
  }
  '
  </code></pre>
  
  <p>Which one should I use? Is there a performance difference? The it looks like they just do the operations in a different order but I'm not sure which is more performant, or what is better convention.</p>