title: How to add mapping in ElasticSearch using JEST
body: <p>I m trying to create an index in ES with specific analyzer and mapping, using JEST.</p>
  <p>I m using the following code:</p>
  <pre><code> CreateIndex createIndex =  new CreateIndex.Builder(indexName)
      .settings(
              ImmutableSettings.builder()
                      .loadFromClasspath(
                              &quot;jestconfiguration.json&quot;
                      ).build().getAsMap()
      ).build();
      
      JestResult result = client.execute(createIndex);
  </code></pre>
  <p>And this is the jestconfiguration.java</p>
  <pre><code>{
    &quot;settings&quot;: {
      &quot;analysis&quot;: {
        &quot;analyzer&quot;: {
          &quot;second&quot;: {
            &quot;type&quot;: &quot;custom&quot;,
            &quot;tokenizer&quot;: &quot;standard&quot;,
            &quot;filter&quot;: [
              &quot;lowercase&quot;,
              &quot;synonym&quot;
            ]
          }
        },
        &quot;filter&quot;: {
          &quot;synonym&quot; : {
              &quot;type&quot; : &quot;synonym&quot;,
              &quot;synonyms&quot; : [
                  &quot;smart phone =&gt; smartphone&quot;
                  ]             
                      }
                  }
          }
    },
      &quot;mappings&quot;: {
      &quot;index_type&quot;: {
        &quot;properties&quot;: {
          &quot;Name&quot;: {
            &quot;type&quot;: &quot;string&quot;,
            &quot;analyzer&quot;: &quot;second&quot;
          }
        }
      }
    }
  }
  </code></pre>
  <p>While, the index is crated correctly with the specified &quot;settings&quot;, the &quot;mappings &quot;section does not work and I m not able to set the mapping for the field &quot;Name&quot;. Anybody has an idea?</p>
  <p>Is there are a sort of <code>putmapping()</code>  in jest that lets you add the mappings? Ideally I d like to be able to set the field_name dynamically and not in the .json file.</p>