fix dynamic_type in dynamic_template

closes #5256
This commit is contained in:
Kevin Wang 2014-03-27 15:41:45 +11:00 committed by Luca Cavanna
parent 34e9f8e83b
commit 8ab22a53fe
2 changed files with 4 additions and 7 deletions

View File

@ -154,7 +154,7 @@ public class DynamicTemplate {
}
public String mappingType(String dynamicType) {
return mapping.containsKey("type") ? mapping.get("type").toString() : dynamicType;
return mapping.containsKey("type") ? mapping.get("type").toString().replace("{dynamic_type}", dynamicType).replace("{dynamicType}", dynamicType) : dynamicType;
}
private boolean patternMatch(String pattern, String str) {

View File

@ -5,13 +5,10 @@
"tempalte_1":{
"match":"multi*",
"mapping":{
"type":"multi_field",
"type":"{dynamic_type}",
"index":"analyzed",
"store":"yes",
"fields":{
"{name}":{
"type":"{dynamic_type}",
"index":"analyzed",
"store":"yes"
},
"org":{
"type":"{dynamic_type}",
"index":"not_analyzed",