Elasticsearch在使用Function score进行有意义的有效值聚合时会考虑点赞



我正在使用术语聚合来计算本周所有博客文章中的常见标签。

body: {
query: {
bool: {
filter: { 
"range": {
"created": {
gte: new Date().getWeek(new Date().getWeek() - 1)
}
}
}
}
},
"aggregations": {
"tags": {
"terms": { "field": "tags" },
}
}
}

然而,与其根据最常用的标签进行评分,我想将其偏向于基于字段"有很多赞的帖子上的标签;点赞"int类型。

有人能教我如何把函数得分和聚合结合起来吗?谢谢

再次阅读文档后,我确信使用弹性搜索实际上是不可能的,它需要一个不同的解决方案。

Available parameters in the script are
_subset_freq
Number of documents the term appears in the subset.
_superset_freq
Number of documents the term appears in the superset.
_subset_size
Number of documents in the subset.
_superset_size
Number of documents in the superset.

在执行重要术语聚合脚本时,不能访问文档。

最新更新