elasticsearch 在Elasticsearch的脚本字段中获取自定义计算值
我想在弹性搜索中获得脚本字段中两个值的乘积,如图所示。如何做到这一点 我正在使用下面的聚合代码elasticsearch 在Elasticsearch的脚本字段中获取自定义计算值,elasticsearch,elasticsearch,我想在弹性搜索中获得脚本字段中两个值的乘积,如图所示。如何做到这一点 我正在使用下面的聚合代码 { "aggs": { "mention": { "terms": { "size": 20, "field": "username" }, "aggs": { "mention_hits": {
{
"aggs": {
"mention": {
"terms": {
"size": 20,
"field": "username"
},
"aggs": {
"mention_hits": {
"top_hits": {
"sort": [
{
"published_date": {
"order": "desc"
}
}
],
"_source": {
"include": [
"klout"
]
},
"size": 1
}
},
"user_ranking": {
"max": {
"script": " 123 "
}
}
}
}
}
}