Templates: GET templates doesn't honor the `flat_settings` parameter.

Close #6671
This commit is contained in:
Adrien Grand 2014-07-02 08:42:31 +02:00
parent 67882d78aa
commit a96f9a7c83
3 changed files with 15 additions and 4 deletions

View File

@ -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'}}

View File

@ -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'}}

View File

@ -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)) {