title: difference between max_gram and min_gram in NGram Tokenizer
body: <p>I'm currently trying to configure an elasticsearch index in a .NET project (i'm new to ES).</p>
  
  <p>We are using NEST 7.3.0</p>
  
  <pre><code>client.Indices.Create(lineItemIndex,
                  c =&gt; c
                      .Settings(s =&gt; s
                      .Analysis(a =&gt; a
                          .Analyzers(aa =&gt; aa
                              .Custom("mynGram_analyzer",ca =&gt; ca
                              .Filters(new List&lt;string&gt; {"lowercase"})
                              .Tokenizer("mynGram")))
                          .TokenFilters(tf =&gt; tf
                              .NGram("mynGram", td =&gt; td
                                  .MaxGram(15).MinGram(4)))))
                      .Map&lt;ElasticSearchLineItem&gt;(m =&gt; m
                          .Properties(ps =&gt; ps
                              .Text(ss =&gt; ss
                              .Name(na =&gt; na.LineItemName)
                              .Analyzer("mynGram")))
                          .Properties(ps =&gt; ps
                              .Keyword(kw =&gt; kw
                                  .Name(na =&gt; na.LineItemId)))
                          .Properties(ps =&gt; ps
                              .Text(ss =&gt; ss
                              .Name(na =&gt; na.LineItemNumber)
                              .Analyzer("mynGram")))));
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <blockquote>
    <p>Type: illegal_argument_exception Reason: "The difference between max_gram and min_gram in NGram Tokenizer must be less than or equal to: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-ngram-tokenizer.html" rel="nofollow noreferrer">1</a> but was [11]. This limit can be set by changing the [index.max_ngram_diff] index level setting."</p>
  </blockquote>
  
  <p>I understand what the issue is. But I can't figure out where to set this max_ngram_diff setting. I'm trying to look through <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-ngram-tokenizer.html" rel="nofollow noreferrer">the documentation</a>.</p>
  
  <p>But they use 3 for both min and max.</p>
  
  <p>I've also found an example where they have the setting in the JSON, that gets send to ES, but I can't replicate it, in the c# code. I hope someone can help me.</p>