[source, ruby]
----
response = client.cluster.put_component_template(
  name: 'template_1',
  body: {
    template: {
      settings: {
        number_of_shards: 1
      },
      aliases: {
        "alias1": {},
        "alias2": {
          filter: {
            term: {
              'user.id' => 'kimchy'
            }
          },
          routing: 'shard-1'
        },
        "{index}-alias": {}
      }
    }
  }
)
puts response
----
