ElasticSearch: aggregation on _score field?

后端 未结 2 433
南笙
南笙 2020-12-04 01:59

I would like to use the stats or extended_stats aggregation on the _score field but can\'t find any examples of this being done (i.e., seems like you can only u

2条回答
  •  抹茶落季
    2020-12-04 02:11

    doc.score doesn't seem to work anymore. Using _score seems to work perfectly.

    Example:

    {
        ...,
        "aggregations" : {
            "grades_stats" : { 
                "stats" : { 
                    "script" : "_score" 
                } 
            }
        }
    }
    

提交回复
热议问题