title: elasticsearch: create index with mappings using javascript
body: <p>I'm trying to create an elasticsearch index with mappings using the official javascript client.</p>
  
  <p>My code is as follows:</p>
  
  <pre class="lang-js prettyprint-override"><code>client.indices.create({
      index: "aName",
      "mappings": {
          "aType": {
              "properties": {
                  "aProp1": { "type": "string", "index": "not_analyzed" },
                  "aProp2": { "type": "string", "index": "not_analyzed" },
                  "aProp3": { "type": "string", "index": "not_analyzed" },
                  "aProp4": { "type": "string", "index": "not_analyzed" }
              }
          }
      }
  }, function(err,resp,respcode){
      console.log(err,resp,respcode);
  });
  </code></pre>
  
  <p>However... the index is created but without the mappings....
  The output is: </p>
  
  <pre>
  undefined { ok: true, acknowledged: true } 200
  </pre>
  
  <p>What am I doing wrong?</p>