Skip to content

Commit

Permalink
fix dynamic_type in dynamic_template
Browse files Browse the repository at this point in the history
closes #5256
  • Loading branch information
kzwang authored and javanna committed Mar 28, 2014
1 parent e887f0e commit c1f82a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public boolean hasType() {
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c1f82a2

Please sign in to comment.