Templates: GET templates doesn't honor the `flat_settings` parameter.
Close #6671
This commit is contained in:
parent
67882d78aa
commit
a96f9a7c83
|
@ -16,7 +16,8 @@ setup:
|
||||||
name: test
|
name: test
|
||||||
|
|
||||||
- match: {test.template: "test-*"}
|
- match: {test.template: "test-*"}
|
||||||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
- match: {test.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}}
|
||||||
|
|
||||||
---
|
---
|
||||||
"Get all templates":
|
"Get all templates":
|
||||||
|
|
||||||
|
@ -43,3 +44,13 @@ setup:
|
||||||
local: true
|
local: true
|
||||||
|
|
||||||
- is_true: test
|
- is_true: test
|
||||||
|
|
||||||
|
---
|
||||||
|
"Get template with flat settings":
|
||||||
|
|
||||||
|
- do:
|
||||||
|
indices.get_template:
|
||||||
|
name: test
|
||||||
|
flat_settings: true
|
||||||
|
|
||||||
|
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
- do:
|
- do:
|
||||||
indices.get_template:
|
indices.get_template:
|
||||||
name: test
|
name: test
|
||||||
|
flat_settings: true
|
||||||
|
|
||||||
- match: {test.template: "test-*"}
|
- match: {test.template: "test-*"}
|
||||||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
- do:
|
- do:
|
||||||
indices.get_template:
|
indices.get_template:
|
||||||
name: test
|
name: test
|
||||||
|
flat_settings: true
|
||||||
|
|
||||||
- match: {test.template: "test-*"}
|
- match: {test.template: "test-*"}
|
||||||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
||||||
|
|
|
@ -275,9 +275,7 @@ public class IndexTemplateMetaData {
|
||||||
builder.field("template", indexTemplateMetaData.template());
|
builder.field("template", indexTemplateMetaData.template());
|
||||||
|
|
||||||
builder.startObject("settings");
|
builder.startObject("settings");
|
||||||
for (Map.Entry<String, String> entry : indexTemplateMetaData.settings().getAsMap().entrySet()) {
|
indexTemplateMetaData.settings().toXContent(builder, params);
|
||||||
builder.field(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
|
|
||||||
if (params.paramAsBoolean("reduce_mappings", false)) {
|
if (params.paramAsBoolean("reduce_mappings", false)) {
|
||||||
|
|
Loading…
Reference in New Issue