2013-07-20 15:12:27 -04:00
|
|
|
---
|
2013-09-18 09:29:21 -04:00
|
|
|
"Put template":
|
2013-07-20 15:12:27 -04:00
|
|
|
- do:
|
|
|
|
indices.put_template:
|
|
|
|
name: test
|
|
|
|
body:
|
|
|
|
template: test-*
|
2013-09-17 08:28:14 -04:00
|
|
|
settings:
|
2013-07-20 15:12:27 -04:00
|
|
|
number_of_shards: 1
|
|
|
|
number_of_replicas: 0
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_template:
|
|
|
|
name: test
|
|
|
|
|
|
|
|
- match: {test.template: "test-*"}
|
|
|
|
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
2013-11-26 06:32:25 -05:00
|
|
|
|
|
|
|
---
|
|
|
|
"Put template with aliases":
|
|
|
|
- do:
|
|
|
|
indices.put_template:
|
|
|
|
name: test
|
|
|
|
body:
|
|
|
|
template: test-*
|
|
|
|
aliases:
|
|
|
|
test_alias: {}
|
2014-03-06 06:16:01 -05:00
|
|
|
test_blias: { routing: b }
|
|
|
|
test_clias: { filter: { term: { user: kimchy }}}
|
2013-11-26 06:32:25 -05:00
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_template:
|
|
|
|
name: test
|
|
|
|
|
2014-03-06 06:16:01 -05:00
|
|
|
- match: { test.template: "test-*" }
|
|
|
|
- length: { test.aliases: 3 }
|
2013-11-26 06:32:25 -05:00
|
|
|
- is_true: test.aliases.test_alias
|
2014-03-06 06:16:01 -05:00
|
|
|
- match: { test.aliases.test_blias.index_routing: "b" }
|
|
|
|
- match: { test.aliases.test_blias.search_routing: "b" }
|
|
|
|
- match: { test.aliases.test_clias.filter.term.user: "kimchy" }
|
2013-11-26 06:32:25 -05:00
|
|
|
|
2014-06-06 09:29:20 -04:00
|
|
|
---
|
|
|
|
"Put template create":
|
|
|
|
- do:
|
|
|
|
indices.put_template:
|
|
|
|
name: test
|
|
|
|
create: true
|
|
|
|
body:
|
|
|
|
template: test-*
|
|
|
|
settings:
|
|
|
|
number_of_shards: 1
|
|
|
|
number_of_replicas: 0
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_template:
|
|
|
|
name: test
|
|
|
|
|
|
|
|
- match: {test.template: "test-*"}
|
|
|
|
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
|
|
|
|
|
|
|
- do:
|
|
|
|
catch: request
|
|
|
|
indices.put_template:
|
|
|
|
name: test
|
|
|
|
create: true
|
|
|
|
body:
|
|
|
|
template: test-*
|
|
|
|
settings:
|
|
|
|
number_of_shards: 1
|
|
|
|
number_of_replicas: 0
|
|
|
|
|