我无法在嵌套聚合io_service::work
中使用expression
脚本来访问文档值。
top_hits
输出:
GET stock/_search
{
"from": 0,
"size": 0,
"aggs": {
"dealers": {
"terms": {
"field":"dealerId"
},
"aggs": {
"stocks": {
"top_hits": {
"sort": [
{
"_script": {
"type": "number",
"script": {
"lang": "expression",
"inline": "doc['longitude'].value"
}
}
}
]
}
}
}
}
}