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
|
||||
|
||||
- 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":
|
||||
|
||||
|
@ -43,3 +44,13 @@ setup:
|
|||
local: true
|
||||
|
||||
- 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:
|
||||
indices.get_template:
|
||||
name: test
|
||||
flat_settings: true
|
||||
|
||||
- match: {test.template: "test-*"}
|
||||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
||||
|
@ -54,6 +55,7 @@
|
|||
- do:
|
||||
indices.get_template:
|
||||
name: test
|
||||
flat_settings: true
|
||||
|
||||
- match: {test.template: "test-*"}
|
||||
- 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.startObject("settings");
|
||||
for (Map.Entry<String, String> entry : indexTemplateMetaData.settings().getAsMap().entrySet()) {
|
||||
builder.field(entry.getKey(), entry.getValue());
|
||||
}
|
||||
indexTemplateMetaData.settings().toXContent(builder, params);
|
||||
builder.endObject();
|
||||
|
||||
if (params.paramAsBoolean("reduce_mappings", false)) {
|
||||
|
|
Loading…
Reference in New Issue