sorting - Elastic Search :: 按日期排序,得分较高的文档
问题描述
我想知道如何在不实际对 multi_match 查询进行排序的情况下增加较新文档的概率(基于 publishedDate 值):
{
"from": 0,
"size": 12,
"_source": false,
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "Best Movies",
"fields": [
"publishedDate^1",
"headline^2",
"subheadline^3",
"metaDescription^4",
"metaTitle"
],
"type": "best_fields",
"lenient": true,
"tie_breaker": 0.3
}
}
],
"filter": {
"bool": {
"must": [
{
"term": {
"status.keyword": "published"
}
},
{
"term": {
"taxonomyPaths.verticals.keyword": "primaryvertical"
}
}
]
}
}
}
}
}
如果我添加会发生什么:
"sort": [
{
"publishedDate": {
"order": "desc"
}
}
]
它完全丢失了实际得分较高的文档。如何获得具有更高分值的文档,但将较新的条目“publishedDate”堆叠在结果之上?
解决方案
推荐阅读
- ios - UIStackView 中的动画隐藏子视图超出屏幕
- python - 将dict(具有整数值)转换为json
- ionic-framework - Ionic HttpClient 正在发送 GET 请求而不是 POST
- java - 单击项目时将数据从 RecyclerView 传递到 Fragment
- android - Android 网页会话无尽的生命周期
- c++ - 双向链表类构造函数分段错误
- hibernate - Sprind data JPA:多个OneToMany关系查询
- javascript - 如何安排事件列表
- ios - 在 xcode 12.4 中使用聚合目标构建 xcframework
- c# - 为什么我会为步骤“鉴于我输入密码详细信息”找到不明确的步骤定义 c# specflow