Skip to content

Commit f0554f3

Browse files
committed
Fix index_template resources
Signed-off-by: disaster37 <linuxworkgroup@hotmail.com>
1 parent 55d5ca6 commit f0554f3

2 files changed

Lines changed: 17 additions & 3148 deletions

File tree

es/diff_suppress_funcs.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,19 @@ func parseDotPropertie(key string, value interface{}, result map[string]interfac
105105
}
106106

107107
// Fix `limit` filed is string, not number on ES response
108-
if key == "limit" && reflect.ValueOf(value).Kind() == reflect.Float64 {
109-
result[key] = strconv.Itoa(int(value.(float64)))
108+
converFields := []string {
109+
"limit",
110+
"number_of_routing_shards",
111+
"number_of_replicas",
112+
"number_of_shards",
110113
}
114+
for _, field := range converFields {
115+
if key == field {
116+
if reflect.ValueOf(value).Kind() == reflect.Float64 {
117+
result[key] = strconv.Itoa(int(value.(float64)))
118+
}
119+
break
120+
}
121+
}
122+
111123
}

0 commit comments

Comments
 (0)