弹性search索引模板的创build

我对弹性search很新,在我使用弹性search的节点程序中。 在这个我试图创build一个"Index Template"但我收到错误:

查询:

  client.indices.putTemplate({ "name":"mfi1", "template" : "te*" }).then(function(res){ console.log(res); }, function(error){ console.log(error); }); 

但是我收到错误:

  { "error": "ElasticsearchParseException[Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@1]", "status": 400 } 

帮我解决这个问题。

雅我发现一个解决scheme:

我重build我的查询如下:

 { name : "mfi3", body:{ "template" : "te*", "settings" : { "number_of_shards" : 1 }, "mappings" : { "type1" : { "_source" : { "enabled" : false } } } } }; 

它的工作正常。