在我的搜索中,我有这个:
body_options: {
aggs: {
expenditure: {
terms: {
field: "parent_id"
},
aggs: {
wbs: {
terms: {
field: "wbs_item_id"
},
aggs: {
"committed": {
"sum": {
"field": "committed"
}
},
"invoiced_against": {
"sum": {
"field": "committed_accrued"
}
}
}
}
}
}
}
}
这是我的结果:
"buckets" => [{
"key" => 6, "doc_count" => 3, "committed" => {
"value" => 6123.0
}, "invoiced_against" => {
"value" => 999.0
}
}, {
"key" => 7, "doc_count" => 3, "committed" => {
"value" => 0.15585599975585938e4
}, "invoiced_against" => {
"value" => 500.0
}
}, {
"key" => 4, "doc_count" => 1, "committed" => {
"value" => 0.0
}, "invoiced_against" => {
"value" => 452.0
}
}, {
"key" => 5, "doc_count" => 1, "committed" => {
"value" => 0.0
}, "invoiced_against" => {
"value" => 452.0
}
}]
我在一些站点上看到了'key_as_string',在我自己的布尔值结果中(添加了true / false)。我已经读过它是为了允许人们阅读密钥的版本而添加的。可以将其添加到ES / SK结果中吗?