forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix loading templates in config/ directory
The fixes introduced in elastic#4235 and elastic#4411 do not take into account, that a template JSON in the config/ directory includes a template name, as opposed when calling the Put Template API. This PR allows to put both formats (either specifying a template name or not) into files. However you template name/id may not be one of the template element names like "template", "settings", "order" or "mapping". Closes elastic#4511
- Loading branch information
Showing
6 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/test/java/org/elasticsearch/indices/template/template3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"mytemplate" : { | ||
"template" : "foo*", | ||
"settings" : { | ||
"index.number_of_shards": 10, | ||
"index.number_of_replicas": 0 | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/java/org/elasticsearch/indices/template/template4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"mytemplate" : { | ||
"template" : "foo*", | ||
"settings" : { | ||
"number_of_shards": 10, | ||
"number_of_replicas": 0 | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/java/org/elasticsearch/indices/template/template5.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"mytemplate" : { | ||
"template" : "foo*", | ||
"settings" : { | ||
"index" : { | ||
"number_of_shards": 10, | ||
"number_of_replicas": 0 | ||
} | ||
} | ||
} | ||
} |