title: using elasticssearch client to create indices
body: <p>I am trying to use elasticsearch's official client in nodejs to create indices for chouchDB. Will really appreciate any help. </p>
  
  <p>This is how I am creating an index: </p>
  
  <pre><code>esClient.indices.create({index: "users_index",
              body: {
                  "type" : "couchdb",
                  "couchdb" : {
                      "host" : "localhost",
                      "port" :"5984",
                      "db" :"users"
                  },
                  "index" : {
                      "index" : "users_index",
                      "type" : "users",
                      "bulk_size" : "100",
                      "bulk_timeout" : "10ms"
                  }
              }}).then(function(x){
                  console.log(x);
                  callback(null);
              },
              function(err){
                  console.log(err);
                  callback(null);
              });
  </code></pre>
  
  <p>When I search for data like this in sense (GET users_index/users_index/_search), I get this without any data:
       {
       "took": 1,
       "timed_out": false,
       "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
       },
       "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
       }
      }    </p>
  
  <p>I'll really appreciate any help.</p>
  
  <p>Before creating index, I am also trying to create an index template so that all my indices get the same mapping. I am doing it like following. I have not gone that far to verify if its correct. Please let me know if there are any errors in this.</p>
  
  <pre><code>esClient.indices.putTemplate({
              name: "vw_index_template",
              body:{
                  "template" : "*_index",
                  "settings" : {
                      "number_of_shards" : 1
                  },
                  "mappings" : {
                      "id_prkey_template" : {
                          "properties" : {
                              "_id" : {"type" : "string", "index": "not_analyzed"},
                              "prkey" : {"type" : "string", "index": "analyzed"}
                          }
                      }
                  }
              }
          }).then(function(res){
              console.log(res);
              callback(null);
  
          }, function(error){
              console.log(error);
              callback(null);
          });
  </code></pre>
  
  <p>Will really appreciate any help.</p>
  
  <p>Many thanks.</p>