Javascript and index templates

I'm trying to create an index template as followed:

client.indices.putTemplate({name:"loctmplt",  body: {
 index_patterns: ['*'],
  template: {
    mappings: {
      properties: {
        location: {
          properties: {
            coordinates: {
              type: "geo_point",
              ignore_malformed: false,
              ignore_z_value: true
            }
          }
        }
      }
    }
  }
}}).then( res => console.log(res), err => console.error(err))

This creates an empty legacy index template, how do I create a modern working index template? Information about this is difficult to find.

I did not check but I'd expect another method for this like putIndexTemplate.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.