如何使用表达式脚本访问嵌套的聚合top_hits中的doc值?

时间:2018-07-02 06:21:03

标签: elasticsearch kibana

我无法在嵌套聚合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"
                            }
                         }
                      }
                 ]
              }
          }
      }
    }
  }

0 个答案:

没有答案