【问题标题】:Elasticsearch size before sort排序前的 Elasticsearch 大小
【发布时间】:2016-04-11 20:56:56
【问题描述】:

是否可以在 elasticsearch 中进行某种嵌套排序/大小?我正在尝试查找所有查询结果(按分数排序,因此最佳匹配排在第一位),将输出限制为 200 个结果,然后应用排序/分页。

示例:用户正在搜索产品。搜索找到 10 000 个匹配的产品,但得分不同(我们使用非常广泛的搜索,所以我们总是会得到很多结果)。我们选取 200 个最佳匹配条目,应用用户定义的排序(例如,用户可能希望按类别对结果进行排序)并显示为具有 10 个结果/页的列表。

所以基本上我需要做以下事情:

1. Perform search for product named "abc"
2. Sort results by score
3. Take first 200 results
4. Sort these 200 results by category
5. Take first 10 results to display them on first page

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    似乎rescoring 将完全按照您的描述进行。

    【讨论】:

    • 感谢您的回复!似乎重新评分不能用于排序。我发现an article 声明:Sometimes we want to show results, where the ordering of the first documents on the page is affected by the additional rules. Unfortunately this cannot be achieved by the rescore functionality.
    • @emsi 是的,但是您可以按类别对结果重新评分,这将得到与按类别排序相同的结果。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-25
    • 2018-12-14
    • 1970-01-01
    • 1970-01-01
    • 2017-04-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多