fix wrong group value when terms agg on boolean field

This commit is contained in:
liugq 2023-06-28 18:12:18 +08:00
parent 50780e5709
commit d660255c36
1 changed files with 3 additions and 0 deletions

View File

@ -305,6 +305,9 @@ func collectMetricDataOther(agg interface{}, groupValues []string, metricData *[
for _, bk := range bks {
if bkVal, ok := bk.(map[string]interface{}); ok {
currentGroup := util.ToString(bkVal["key"])
if v := util.ToString(bkVal["key_as_string"]); v == "true" || v == "false" {
currentGroup = v
}
newGroupValues := make([]string, 0, len(groupValues)+1)
newGroupValues = append(newGroupValues, groupValues...)
newGroupValues = append(newGroupValues, currentGroup)